* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* ========== Navigation Bar ========== */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-brand:hover {
    color: #007bff;
}

.brand-icon {
    font-size: 24px;
}

.brand-text {
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    white-space: nowrap;
}

.nav-link:hover {
    background: #f0f0f0;
    color: #007bff;
}

.btn-login {
    background: #007bff;
    color: white !important;
}

.btn-login:hover {
    background: #0056b3;
}

/* ========== Dropdown Menu ========== */
.nav-dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    min-width: 180px;
    padding: 8px 0;
    z-index: 1000;
}

.dropdown-right {
    left: auto;
    right: 0;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: #f5f5f5;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
}

/* ========== User Menu ========== */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 12px;
    color: #999;
}

/* ========== Membership Badge ========== */
.nav-membership {
    padding: 6px 12px !important;
}

.membership-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
}

.membership-badge.premium {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.membership-badge.normal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.membership-badge.free {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

/* ========== Mobile Menu ========== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 999;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-user-info {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 20px;
}

.user-name-large {
    font-size: 18px;
    font-weight: 600;
}

.mobile-link {
    display: block;
    padding: 16px 24px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-link:hover {
    background: #f5f5f5;
}

.mobile-divider {
    height: 8px;
    background: #f5f5f5;
}

/* ========== Main Content ========== */
.main-content {
    min-height: calc(100vh - 60px);
    padding: 24px;
}

/* ========== Flash Messages ========== */
.flash-messages {
    max-width: 800px;
    margin: 0 auto 16px;
}
.flash-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}
.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    .brand-text {
        font-size: 16px;
    }

    .main-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0 16px;
    }

    .brand-text {
        display: none;
    }
}
