/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* ==================== SHELL LAYOUT ==================== */
.shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== HEADER ==================== */
.header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(242, 168, 58, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 20px;
}

/* Logo */
.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.logo-text span {
    color: #f2a83a;
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: #f2a83a;
}

/* Auth Area */
.auth-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline:hover {
    border-color: #f2a83a;
    color: #f2a83a;
    background: rgba(242, 168, 58, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #f2a83a, #e5982b);
    color: #0f172a;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(242, 168, 58, 0.3);
}

.btn-block {
    width: 100%;
    padding: 12px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f2a83a, #e5982b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-weight: 700;
}

.user-name {
    font-weight: 500;
    font-size: 0.85rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    display: none;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 101;
}

.user-dropdown.show {
    display: block;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.user-dropdown a:hover {
    background: rgba(242, 168, 58, 0.1);
    color: #f2a83a;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    background: rgba(242, 168, 58, 0.2);
}

/* ==================== MOBILE SIDEBAR ==================== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #0f172a;
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.mobile-sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #f2a83a, #e5982b);
}

.sidebar-logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
}

.sidebar-logo span {
    color: white;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #0f172a;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-link i {
    width: 24px;
    font-size: 1.1rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(242, 168, 58, 0.1);
    color: #f2a83a;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f2a83a, #e5982b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0f172a;
}

.sidebar-user-details {
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-user-plan {
    font-size: 0.7rem;
    color: #f2a83a;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

.sidebar-overlay.open {
    display: block;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    position: relative;
    background: #f8fafc;
}

.content-wrapper {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 70px);
}

.content-frame {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 70px);
    border: none;
    background: white;
    display: block;
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(242, 168, 58, 0.2);
    padding: 8px 16px 12px;
    z-index: 90;
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 30px;
    transition: all 0.2s;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.6);
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.bottom-nav-item.active i,
.bottom-nav-item.active span {
    color: #f2a83a;
}

.bottom-nav-item:hover {
    background: rgba(242, 168, 58, 0.1);
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-container {
    position: relative;
    background: #1e293b;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    z-index: 2001;
    animation: modalFadeIn 0.3s ease;
    border: 1px solid rgba(242, 168, 58, 0.2);
}

.modal-sm {
    max-width: 400px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.modal-header h3 i {
    color: #f2a83a;
    margin-right: 8px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 70px);
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 50px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 40px;
    background: transparent;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: linear-gradient(135deg, #f2a83a, #e5982b);
    color: #0f172a;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: 'Inter', sans-serif;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    outline: none;
    border-color: #f2a83a;
    box-shadow: 0 0 0 3px rgba(242, 168, 58, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: #f2a83a;
    text-decoration: none;
    font-size: 0.85rem;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.85rem;
    z-index: 3000;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    border: 1px solid rgba(242, 168, 58, 0.3);
}

.toast.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .nav-desktop {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .main-content {
        padding-bottom: 70px;
    }
    
    .content-frame {
        min-height: calc(100vh - 130px);
    }
    
    .user-name {
        display: none;
    }
    
    .user-trigger {
        padding: 4px 8px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .toast {
        white-space: normal;
        text-align: center;
        max-width: 90%;
        font-size: 0.8rem;
    }
}

@media (min-width: 769px) {
    .content-frame {
        min-height: calc(100vh - 70px);
    }
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 60px;
    color: #94a3b8;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 12px;
    animation: spin 1s linear infinite;
    color: #f2a83a;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #f2a83a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e5982b;
}
/* ==================== ACCOUNT MODAL - MOBILE BOTTOM SHEET ==================== */
#accountModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
}

#accountModal.show {
    display: flex !important;
}

#accountModal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
    z-index: 10001;
}

#accountModal .modal-container {
    position: relative;
    background: #1e293b;
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    z-index: 10002;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(242, 168, 58, 0.2);
    max-height: 85vh;
    overflow: hidden;
    margin: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Desktop: Center the modal */
@media (min-width: 769px) {
    #accountModal {
        align-items: center;
    }
    
    #accountModal .modal-container {
        border-radius: 24px;
        width: 90%;
        max-width: 450px;
        animation: modalFadeIn 0.3s ease;
    }
    
    @keyframes modalFadeIn {
        from {
            opacity: 0;
            transform: scale(0.95);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }
}

/* Mobile: Bottom sheet specific styles */
@media (max-width: 768px) {
    #accountModal .modal-container {
        border-radius: 24px 24px 0 0;
        max-height: 80vh;
    }
    
    /* Add drag handle indicator for mobile */
    #accountModal .modal-container::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        z-index: 10003;
    }
}

#accountModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#accountModal .modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

#accountModal .modal-header h3 i {
    color: #f2a83a;
    margin-right: 8px;
}

#accountModal .modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#accountModal .modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
}

#accountModal .modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#accountModal .modal-body::-webkit-scrollbar {
    display: none;
}

/* Account User Info */
.account-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-bottom: 20px;
}

.user-avatar-large {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f2a83a, #e5982b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 600;
    color: #0f172a;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: white;
    font-size: 1rem;
    margin-bottom: 4px;
}

.user-plan {
    color: #f2a83a;
    font-size: 0.8rem;
}

/* Account Menu Items */
.account-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}

.menu-item:hover {
    background: rgba(242, 168, 58, 0.1);
}

.menu-item i:first-child {
    width: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

.menu-item span {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.menu-item i:last-child {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

.menu-item.logout {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-top: 16px;
}

.menu-item.logout i:first-child,
.menu-item.logout span {
    color: #ff6b6b;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}