* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #007AFF;
    --primary-purple: #5856D6;
    --dark-blue: #1d1d1f;
    --light-gray: #f5f5f7;
    --medium-gray: #86868b;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--dark-blue);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Floating Elements Background */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.float-element {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 50%;
    animation: float 20s infinite linear;
}

.float-element:nth-child(1) { width: 80px; height: 80px; top: 20%; left: 10%; animation-delay: 0s; }
.float-element:nth-child(2) { width: 120px; height: 120px; top: 60%; left: 80%; animation-delay: 5s; }
.float-element:nth-child(3) { width: 60px; height: 60px; top: 80%; left: 20%; animation-delay: 10s; }
.float-element:nth-child(4) { width: 100px; height: 100px; top: 30%; left: 70%; animation-delay: 15s; }

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-100px) rotate(180deg); opacity: 1; }
    100% { transform: translateY(0px) rotate(360deg); opacity: 0.7; }
}

/* Glass Navigation */
.nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    z-index: 1000;
    padding: 12px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.nav:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 16px;
    border-radius: 12px;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* When navbar is on white background (like in mocktest-list), use dark text */
.nav-on-white {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.nav-on-white .nav-links a {
    color: rgba(0, 0, 0, 0.8) !important;
}

.nav-on-white .nav-links a:hover, 
.nav-on-white .nav-links a.active {
    color: var(--dark-blue) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.nav-on-white .logo {
    background: linear-gradient(135deg, var(--dark-blue), #333) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.nav-on-white .user-profile {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--dark-blue) !important;
}

.login-btn, .logout-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
}

.login-btn:hover, .logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 122, 255, 0.4);
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 40px 40px 0 0;
    margin-top: 120px;
    position: relative;
    z-index: 3;
    min-height: calc(100vh - 120px);
}

/* Page Header */
.page-header {
    padding: 80px 24px 60px;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05), rgba(88, 86, 214, 0.05));
    border-radius: 40px 40px 0 0;
}

.page-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--dark-blue);
    line-height: 1.1;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--medium-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Topics Container */
.topics-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

.topic-card {
    background: white;
    border-radius: 28px;
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.topic-card:hover::before {
    transform: scaleX(1);
}

.topic-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 122, 255, 0.1);
}

.topic-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    border-radius: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    transition: all 0.4s ease;
}

.topic-card:hover .topic-icon {
    transform: scale(1.1) rotate(5deg);
}

.topic-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark-blue);
    line-height: 1.3;
}

.topic-description {
    color: var(--medium-gray);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.view-tests-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.view-tests-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 122, 255, 0.4);
}

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

/* Stats Section */
.stats-section {
    background: var(--light-gray);
    padding: 60px 24px;
    margin-top: 40px;
}

.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.stats-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--dark-blue);
}

.stats-subtitle {
    font-size: 1.1rem;
    color: var(--medium-gray);
    margin-bottom: 48px;
}

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

.stat-card {
    background: white;
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--medium-gray);
    font-size: 14px;
    font-weight: 500;
}

/* Services Section */
.services-section {
    padding: 80px 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    margin-top: 80px;
}

.services-container {
    max-width: 1200px;
    margin: 0 auto;
}

.services-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.95);
}

.services-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.service-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007AFF, #5856D6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: block;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Android Emoji", "EmojiOne Color", "EmojiSymbols", "Symbola", "Twemoji Mozilla", "Segoe UI Symbol", sans-serif;
    line-height: 1;
    text-rendering: optimizeLegibility;
}

.service-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.95);
}

.service-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background: var(--dark-blue);
    color: var(--medium-gray);
    padding: 60px 24px 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 48px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 16px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: var(--medium-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.footer-section ul li a:hover {
    color: white;
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid #424245;
    padding-top: 24px;
    text-align: center;
    color: var(--medium-gray);
    font-size: 14px;
}

/* Topic Card States */
.topic-card.locked {
    opacity: 0.7;
    filter: grayscale(0.3);
}

.topic-card.unlocked {
    opacity: 1;
    filter: none;
}

/* Topic Status */
.topic-status {
    margin-bottom: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.unlocked {
    background: #34C759;
    color: white;
}

.status-badge.locked {
    background: #FF3B30;
    color: white;
}

/* Topic Actions */
.topic-actions {
    margin-top: 15px;
}

.unlock-btn {
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.unlock-btn:hover {
    background: linear-gradient(135deg, #FF6B00 0%, #FF4500 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.3);
}

.unlock-limit-reached {
    color: #FF3B30;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    padding: 8px;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 8px;
}

.login-btn {
    background: var(--primary-blue);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.login-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3);
}

/* Plan Badges */
.plan-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.plan-free {
    background: #E5E7EB;
    color: #374151;
}

.plan-silver {
    background: #C0C0C0;
    color: #FFFFFF;
}

.plan-gold {
    background: #FFD700;
    color: #000000;
}

.plan-platinum {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #FFFFFF;
}

/* Messages */
.message {
    padding: 12px 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-weight: 500;
    text-align: center;
}

.message.success {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.message.error {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--glass-bg);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 40px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 30px;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 2rem;
    color: var(--dark-blue);
    margin-bottom: 15px;
    font-weight: 600;
}

.empty-state p {
    color: var(--medium-gray);
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .topic-card {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Smooth Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(60px);
    animation: fadeInUp 0.8s ease-out forwards;
}

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

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0056CC, #4A47C4);
}
