@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #000000;
    --ipad-system-gray: #1c1c1e;
    --ipad-card: rgba(30, 30, 32, 0.7);
    --accent: #0ea5e9;
    /* Sky Blue Alpha */
    --accent-solid: #38bdf8;
    --glass: rgba(28, 28, 30, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --danger: #ff453a;
    --success: #32d74b;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    --transition-speed: 0.4s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    perspective: 1000px;
}

/* Page Transition Animation - Ultra Fast iPad Style Slide */
.page-transition {
    animation: slideIn 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    width: 100%;
}

@keyframes slideIn {
    from {
        transform: translateX(30px);
        opacity: 0.5;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.page-exit {
    animation: slideOut 0.12s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-30px);
        opacity: 0.5;
    }
}

/* iPad Style Layout Wrapper */
.ipad-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Sidebar Navigation (iPad Settings Style) */
.sidebar {
    width: 280px;
    background: var(--ipad-system-gray);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    background: var(--ipad-system-gray);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

/* For pages that shouldn't have a sidebar (like login) */
.full-page-center {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--ipad-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--accent-solid);
}

h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: 16px;
}

/* Components */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-img {
    width: 80px;
    height: auto;
    border-radius: 18px;
    /* App Icon style */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-solid);
    color: #000;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

.btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-solid);
}

.btn.danger {
    background: var(--danger);
    color: white;
}

/* Navigation Links */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: background 0.2s;
    gap: 12px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--accent-solid);
    color: #000;
}

/* Cards & Lists */
.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stat-item {
    background: var(--ipad-card);
    padding: 15px;
    border-radius: 16px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-solid);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* FIX DROPDOWN COLORS */
select option {
    background-color: #1e1e1e;
    color: white;
}

/* Quiz UI (Tablet Style) */
.progress-container {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    background: var(--accent-solid);
    height: 100%;
    transition: width 0.4s ease-out;
}

.choices {
    display: grid;
    gap: 15px;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    color: var(--text-primary);
    text-align: left;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-solid);
}

.choice-btn.selected {
    background: var(--accent-solid);
    color: #000;
    border-color: var(--accent-solid);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
        /* In high-end design, we might use a bottom dock or drawer */
    }

    .ipad-container {
        padding: 10px;
    }

    .main-content {
        padding: 20px;
    }
}

/* Utility */
.mb-20 {
    margin-bottom: 20px;
}

.scroll-hide::-webkit-scrollbar {
    display: none;
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
}

.badge-success {
    background: rgba(50, 215, 75, 0.2);
    color: #32d74b;
}

.badge-danger {
    background: rgba(255, 69, 58, 0.2);
    color: #ff453a;
}

/* Dashboard Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.validated-banner {
    animation: pulse 3s infinite ease-in-out;
    background: linear-gradient(135deg, rgba(50, 215, 75, 0.2), rgba(0, 0, 0, 0.5));
    border: 1px solid var(--success);
}

/* --- STEPPER & GOLD GLOW --- */
.gold-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
    border: 2px solid transparent;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    transition: color 0.5s;
}

/* Active & Completed States */
.step-item.active .step-circle {
    background: #FFD700;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}

.step-item.active .step-label {
    color: #FFD700;
}

.step-item.completed .step-circle {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    border-color: #FFD700;
}

.step-item.completed .step-label {
    color: rgba(255, 215, 0, 0.8);
}

.step-line {
    position: absolute;
    top: 38px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.step-line-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #B8860B);
    transition: width 0.8s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* --- DISCORD WELCOME HEADER --- */
.user-welcome-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.user-avatar-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-info-text h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-info-text span {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PWA RESPONSIVENESS --- */
@media (max-width: 600px) {
    .gold-stepper {
        padding: 15px 10px;
    }

    .step-label {
        font-size: 9px;
    }

    .user-info-text span {
        font-size: 15px;
    }
}