:root {
    --bg-dark: #0f0f13;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    
    --primary: #6d28d9;
    --primary-glow: rgba(109, 40, 217, 0.5);
    --primary-hover: #5b21b6;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --font-ui: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Blobs for Glassmorphism Context */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}
.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(109, 40, 217, 0.3);
    top: -100px;
    left: -100px;
}
.blob-2 {
    width: 300px;
    height: 300px;
    background: rgba(56, 189, 248, 0.2);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

#app {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Views */
.view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.view.active {
    display: flex;
    opacity: 1;
}

/* Login / Register Panel */
#login-view,
#register-view {
    margin: auto;
    width: 100%;
    max-width: 400px;
    flex-direction: column;
    padding: 3rem 2rem;
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}
.logo-container .logo {
    width: 80px;
    margin-bottom: 1rem;
}
.logo-container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.logo-container p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Forms */
.input-group {
    position: relative;
    margin-bottom: 1.2rem;
}
.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}
.primary-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}
.outline-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}
.outline-btn:hover {
    background: var(--glass-highlight);
}
.outline-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.full-width {
    width: 100%;
}

.error-text {
    color: var(--error);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 1rem;
    min-height: 20px;
}

.auth-switch {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
.auth-switch a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Dashboard */
#dashboard-view {
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
    width: 100%;
}

.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 1.2rem;
}
.nav-logo {
    width: 40px;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}
#nav-username { font-weight: 500; }
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-left: 0.5rem;
}
.icon-btn:hover {
    color: var(--error);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}
.card-header i {
    color: var(--primary);
    font-size: 1.2rem;
}
.card-header h3 {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Card Placements */
.user-card { grid-column: span 8; }
.download-card { grid-column: span 4; }
.redeem-card { grid-column: span 6; }
.changelog-card { grid-column: span 6; }

@media (max-width: 900px) {
    .user-card, .download-card, .redeem-card, .changelog-card {
        grid-column: span 12;
    }
}

/* Stat List */
.stat-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.stat-value {
    font-weight: 500;
}
.code-font {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    word-break: break-all;
    max-width: 60%;
    text-align: right;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}
.badge.expired {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.tier-badge {
    background: var(--primary-glow);
    color: #e2e8f0;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Download specific */
.download-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    justify-content: center;
    flex: 1;
}
.download-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(109, 40, 217, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.8rem;
}
.pulse-glow {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--primary-glow); }
    70% { box-shadow: 0 0 0 10px rgba(109, 40, 217, 0); }
    100% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0); }
}

.action-msg {
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: center;
}
.action-msg.success { color: var(--success); }
.action-msg.error { color: var(--error); }

/* Changelogs */
.changelog-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.changelog-list::-webkit-scrollbar {
    width: 6px;
}
.changelog-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}
.changelog-item {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
}
.changelog-ver {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
}
.changelog-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.changelog-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.notification {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    color: var(--text-main);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
}
.notification.show {
    transform: translateX(0);
}
.notification.success { border-color: var(--success); }
.notification.error { border-color: var(--error); }
.notification.warning { border-color: var(--warning); }
.notification i { font-size: 1.2rem; }
.notification.success i { color: var(--success); }
.notification.error i { color: var(--error); }
.notification.warning i { color: var(--warning); }
