/* ===== CSS Reset & Variables ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #12121f;
    --bg-card: rgba(20, 20, 35, 0.8);
    --bg-card-hover: rgba(28, 28, 48, 0.9);
    --bg-input: rgba(30, 30, 50, 0.6);
    --border: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(120, 100, 255, 0.5);

    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-tertiary: #555570;

    --accent: #7c6aff;
    --accent-hover: #8f7dff;
    --accent-glow: rgba(124, 106, 255, 0.3);
    --accent-subtle: rgba(124, 106, 255, 0.1);

    --success: #34d399;
    --success-glow: rgba(52, 211, 153, 0.2);
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    padding: 80px 0 48px;
    text-align: center;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 100px;
    background: var(--accent-subtle);
    border: 1px solid rgba(124, 106, 255, 0.2);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero h1 .accent {
    background: linear-gradient(135deg, var(--accent), #a78bfa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-subtle);
    color: var(--accent);
    flex-shrink: 0;
}

/* ===== Form ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-grid .form-group:last-child {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(35, 35, 60, 0.6);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), #6d5ddf);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #7e6eef);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
    transform: translateY(-1px);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(124, 106, 255, 0.12);
    color: var(--accent);
    border: 1px solid rgba(124, 106, 255, 0.2);
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-secondary:hover {
    background: rgba(124, 106, 255, 0.2);
    border-color: rgba(124, 106, 255, 0.3);
}

.btn-update {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-update:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* ===== Passes List ===== */
.passes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pass-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    animation: slide-in 0.3s ease-out;
}

.pass-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--bg-card-hover);
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pass-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1a1a2e, #2a2a4e);
    flex-shrink: 0;
    color: var(--accent);
    border: 1px solid var(--border);
}

.pass-info {
    flex: 1;
    min-width: 0;
}

.pass-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.pass-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pass-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pass-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.empty-state p {
    margin-top: 12px;
    font-size: 0.9rem;
}

/* ===== Activity Log ===== */
.activity-log {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    animation: slide-in 0.2s ease-out;
}

.log-time {
    color: var(--text-tertiary);
    flex-shrink: 0;
    min-width: 50px;
}

.log-msg {
    color: var(--text-secondary);
    word-break: break-word;
}

.log-entry.log-success .log-msg { color: var(--success); }
.log-entry.log-error .log-msg { color: var(--danger); }
.log-entry.log-info .log-msg { color: var(--info); }
.log-entry.log-warning .log-msg { color: var(--warning); }

/* ===== Toast ===== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease-out;
    max-width: 360px;
    border: 1px solid var(--border);
}

.toast.toast-success {
    background: rgba(10, 40, 30, 0.9);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--success);
}

.toast.toast-error {
    background: rgba(40, 10, 10, 0.9);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger);
}

.toast.toast-info {
    background: rgba(10, 20, 40, 0.9);
    border-color: rgba(96, 165, 250, 0.3);
    color: var(--info);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* ===== Update Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-actions .btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 10px 20px;
}

.modal-actions .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-actions .btn-confirm {
    background: linear-gradient(135deg, var(--success), #2cb885);
    color: white;
    padding: 10px 20px;
}

.modal-actions .btn-confirm:hover {
    transform: translateY(-1px);
}

/* ===== Spinner ===== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .pass-item {
        flex-wrap: wrap;
    }

    .pass-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .card {
        padding: 20px;
    }
}
