@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #030406;
    color: #cbd5e1;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font: inherit;
    border: none;
    outline: none;
}

.site-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 48px);
    max-width: 1300px;
    background: rgba(3, 4, 6, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.header-inner {
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: contain;
}

.logo-text {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.btn-login {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.3s;
}

.btn-login:hover {
    color: #fff;
}

.btn-register {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    transition: all 0.3s;
}

.btn-register:hover {
    background: #2563eb;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary {
    padding: 14px 38px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    transition: all 0.3s;
    letter-spacing: 0.3px;
    display: inline-block;
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.main-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 80px;
}

.form-card {
    max-width: 440px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 48px 40px;
    backdrop-filter: blur(20px);
}

.form-card-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-card-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.form-card-subtitle {
    font-size: 14px;
    color: #475569;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder {
    color: #475569;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.link-group {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.link-group a {
    color: #60a5fa;
    font-size: 14px;
    transition: color 0.3s;
    display: inline-block;
}

.link-group a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.link-group a + a {
    margin-top: 12px;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.dashboard-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
}

.dashboard-sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(3, 4, 6, 0.9);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-logo-section {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 24px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: contain;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 0 16px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    color: #94a3b8;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav a + a {
    margin-top: 4px;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.sidebar-nav a.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sidebar-footer {
    padding: 0 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 24px;
}

.sidebar-footer a,
.sidebar-footer button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #f87171;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-footer a:hover,
.sidebar-footer button:hover {
    background: rgba(239, 68, 68, 0.15);
}

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-header {
    background: rgba(3, 4, 6, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.3));
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 20px;
}

.header-user-details .header-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.header-user-details .header-id {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.activate-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
    flex: 1;
}

.activate-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 12px 18px;
    font-size: 14px;
    color: #fff;
}

.activate-bar input::placeholder {
    color: #475569;
}

.btn-activate {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-activate:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-activate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dashboard-content {
    flex: 1;
    padding: 40px;
}

.dashboard-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.software-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.software-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.software-card-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.2));
    padding: 32px 24px;
    text-align: center;
}

.software-card-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.software-card-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.software-card-body {
    padding: 24px;
}

.software-expire {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.software-expire-label {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.software-expire-value {
    font-size: 14px;
    font-weight: 600;
}

.software-expire-value.green {
    color: #4ade80;
}

.software-expire-value.red {
    color: #f87171;
}

.software-expire-value.yellow {
    color: #facc15;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.download-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.download-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(59, 130, 246, 0.05);
}

.download-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 24px;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
    min-width: 0;
}

.download-name {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.download-desc {
    font-size: 13px;
    color: #64748b;
}

.download-arrow {
    color: #60a5fa;
    font-size: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
    color: #64748b;
}

.hidden {
    display: none !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease both;
}

@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .site-header {
        width: calc(100% - 24px);
        top: 12px;
    }
    
    .header-inner {
        padding: 0 16px;
    }
    
    .main-container {
        padding-top: 100px;
    }
    
    .form-card {
        padding: 32px 24px;
        margin: 0 16px;
    }
    
    .dashboard-header {
        padding: 16px 20px;
    }
    
    .dashboard-content {
        padding: 24px 20px;
    }
    
    .software-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header-inner {
        flex-direction: column;
        align-items: stretch;
    }
    
    .activate-bar {
        max-width: 100%;
    }
}

/* === Subscription Cards (Image Background Style) === */
.subscription-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.subscription-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: flex-end;
}

.subscription-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.subscription-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}

.subscription-card-info {
    position: relative;
    z-index: 2;
    padding: 24px;
    width: 100%;
}

.subscription-card-name {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.subscription-card-expire {
    display: flex;
    align-items: center;
    gap: 8px;
}

.subscription-expire-label {
    font-size: 13px;
    color: #94a3b8;
}

.subscription-expire-value {
    font-size: 20px;
    font-weight: 800;
}

.subscription-expire-value.green {
    color: #4ade80;
}

.subscription-expire-value.red {
    color: #f87171;
}

.subscription-expire-value.yellow {
    color: #facc15;
}

/* === Unified Dashboard Styles === */
.dashboard-layout,
.dashboard-sidebar,
.dashboard-main {
    position: relative;
    z-index: 1;
}

.dashboard-layout {
    min-height: 100vh;
    display: flex;
    position: relative;
    padding-top: 92px;
}

.dashboard-sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(3, 4, 6, 0.82) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px !important;
    margin: 16px;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    height: calc(100vh - 32px);
    left: 0;
    top: 0;
}

.dashboard-main {
    flex: 1;
    margin-left: 292px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.dashboard-header {
    background: rgba(3, 4, 6, 0.82) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px !important;
    padding: 12px 24px;
    position: fixed;
    left: 292px;
    right: 16px;
    top: 16px;
    z-index: 100;
}

.dashboard-content {
    flex: 1;
    padding: 1px;
    padding-top: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.dashboard-section {
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 32px;
}

#subscription.dashboard-section,
#download.dashboard-section,
#settings.dashboard-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
}

.btn-activate:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35) !important;
}

@media (max-width: 768px) {
    .subscription-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .dashboard-header {
        left: 16px;
        right: 16px;
    }
}
