:root {
    --bg-color: #050505;
    --surface-color: rgba(20, 20, 20, 0.6);
    --surface-border: rgba(255, 255, 255, 0.08);
    --text-primary: #F5F0EB;
    --text-secondary: #8A8A8A;
    --accent: #D4A053; /* Warm Amber */
    --accent-glow: rgba(212, 160, 83, 0.4);
    --success: #4ADE80;
    --danger: #EF4444;
    --glass-blur: blur(24px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ambient Background */
.ambient-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(120px);
    opacity: 0.15;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%; left: -10%;
    width: 60vw; height: 60vw;
    background: var(--accent);
}

.blob-2 {
    bottom: -20%; right: -10%;
    width: 50vw; height: 50vw;
    background: #4ADE80;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

/* Layout */
#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex: 1;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism Components */
.glass-card, .glass-panel {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.4);
}

/* Login Screen */
#login-screen {
    align-items: center;
    justify-content: center;
}

.login-card {
    padding: 48px;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.logo-area {
    position: relative;
    margin-bottom: 16px;
}

.glow-orb {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80px; height: 80px;
    background: var(--accent);
    filter: blur(40px);
    opacity: 0.3;
    z-index: -1;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.accent { color: var(--accent); }

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 24px;
}

input, select {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 0 4px rgba(212, 160, 83, 0.1);
}

.btn {
    position: relative;
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.primary-btn {
    background: var(--text-primary);
    color: var(--bg-color);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255,255,255,0.15);
}

.primary-btn:active {
    transform: translateY(0);
}

.hidden { display: none !important; }
.error-msg {
    color: var(--danger);
    font-size: 14px;
    margin-top: 16px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Dashboard */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.text-btn {
    background: transparent;
    color: var(--text-secondary);
    width: auto;
    padding: 8px 16px;
}

.text-btn:hover { color: var(--text-primary); }

.dashboard-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 22px;
    font-weight: 600;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.generate-controls {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 16px;
    align-items: end;
}

label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.align-bottom {
    height: 52px;
    padding: 0 32px;
    width: auto;
}

/* Table */
.database-section {
    padding: 32px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.secondary-btn {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
}

.secondary-btn:hover { background: rgba(255,255,255,0.1); }
.small-btn { padding: 8px 16px; width: auto; font-size: 14px; }

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px;
    border-bottom: 1px solid var(--surface-border);
    background: rgba(0,0,0,0.2);
}

td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.status-badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.status-valid { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.status-used { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.copy-key {
    font-family: 'Inter', monospace;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: opacity 0.2s;
}

.copy-key:hover { opacity: 0.7; }

.mt-20 { margin-top: 20px; }

.new-keys-list {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.new-key-item {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.03);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 15px;
    color: var(--accent);
}
