:root {
    --primary-color: #23467f;
    /* Corporate Blue */
    --secondary-color: #4f83cc;
    /* Lighter Blue for gradients */
    --accent-color: #00d2ff;
    /* Cyan for energetic accents */
    --bg-color: #0f172a;
    /* Slate 900 */
    --surface-color: rgba(30, 41, 59, 0.7);
    /* Slate 800 with opacity */
    --text-color: #f8fafc;
    --input-bg: rgba(51, 65, 85, 0.5);
    --border-color: rgba(148, 163, 184, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(35, 70, 127, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(79, 131, 204, 0.15) 0%, transparent 40%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    perspective: 1000px;
}

.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: #94a3b8;
    font-size: 1rem;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #cbd5e1;
    font-size: 0.95rem;
}

select,
input {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

select:focus,
input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(51, 65, 85, 0.8);
}

/* Remove default appearance */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Button */
.btn-generate {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

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

.btn-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Result Area */
.result-area {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.result-area.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    display: block;
}

.code-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.code-display:hover {
    background: rgba(0, 0, 0, 0.4);
}

.code-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 700;
    word-break: break-all;
}

.copy-hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    padding-bottom: 0.2rem;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Adjust Container for Nav */
.container {
    margin-top: 4rem;
    /* Space for fixed nav */
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-color);
}

th {
    text-align: left;
    padding: 1rem;
    color: #cbd5e1;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

.code-cell {
    font-family: 'Space Mono', monospace;
    color: var(--accent-color);
    font-weight: 700;
}

/* Admin Badges */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.admin {
    background: rgba(35, 70, 127, 0.3);
    color: #90caf9;
    border: 1px solid #4f83cc;
}

.badge.user {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border: 1px solid #94a3b8;
}