/* TASK Minimal Dark Theme */
:root {
    --bg: #121212;
    --bg-secondary: #1A1A1A;
    --card-bg: #1E1E1E;
    --primary: #00BFA6;
    --text: #EAEAEA;
    --text-primary: #EAEAEA;
    --muted: #B5B5B5;
    --success: #27AE60;
    --warning: #F1C40F;
    --danger: #E74C3C;
    --border: #2A2A2A;
    --shadow: 0 6px 20px rgba(0,0,0,0.35);
    --radius: 14px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Utilities */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }

/* Top Navigation */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(18,18,18,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topnav .inner {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
}

.brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #08d7c0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    color: #0f0f0f;
    font-weight: 900;
}

.nav-menu {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-link {
    padding: 8px 16px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(0,191,166,0.1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #171717;
    color: var(--text);
    border: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-menu {
    position: fixed;
    top: 64px;
    left: -100%;
    width: 260px;
    height: calc(100vh - 64px);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    z-index: 99;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.open {
    left: 0;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 98;
}

.mobile-menu-overlay.open {
    display: block;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.mobile-nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

.mobile-nav-link.active {
    color: var(--primary);
    background: rgba(0,191,166,0.1);
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #171717;
    color: var(--text);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Header */
.header {
    padding: 24px 0 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(0,191,166,0.06), rgba(0,0,0,0));
}

.header h1 {
    font-size: 24px;
    margin: 0 0 8px;
    font-weight: 700;
}

.header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* Category Chips */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    background: #161616;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.chip:hover {
    border-color: var(--primary);
}

.chip.active {
    background: rgba(0,191,166,0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Mini Task Cards */
.task-mini {
    width: 180px;
    min-height: 140px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
}

.task-mini .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.badge {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #151515;
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
}

.badge.primary {
    color: var(--primary);
    border-color: rgba(0,191,166,0.4);
    background: rgba(0,191,166,0.1);
}

.badge.danger {
    color: var(--danger);
    border-color: rgba(231,76,60,0.4);
    background: rgba(231,76,60,0.1);
}

.badge.public {
    color: var(--primary);
    border-color: rgba(0,191,166,0.4);
    background: rgba(0,191,166,0.1);
}

.reward {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}

.task-title {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
}

.meta {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    gap: 12px;
    margin-top: auto;
}

/* Swiper */
.swiper {
    padding: 12px 2px 16px;
}

.swiper-slide {
    width: auto;
}

/* Grid List */
.list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.list .task-mini {
    width: 100%;
}

/* Buttons */
.btn {
    border: 1px solid var(--border);
    background: #171717;
    color: var(--text);
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #202020;
}

.btn.primary {
    border-color: var(--primary);
    background: rgba(0,191,166,0.15);
    color: var(--primary);
}

.btn.primary:hover {
    background: rgba(0,191,166,0.25);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    z-index: 999;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: block;
    opacity: 1;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
    padding: 20px;
}

.modal.open {
    pointer-events: auto;
    display: flex !important;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.open .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-card {
    width: min(520px, calc(100% - 32px));
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    padding: 20px;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.open .modal-card {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 18px;
    margin: 0;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.modal-close:hover {
    background: var(--border);
    border-color: var(--danger);
    color: var(--danger);
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #171717;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Section Titles */
.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

/* Spacer */
.spacer {
    height: 24px;
}

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

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Language Selector */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 50px !important;
}

.current-lang {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(0, 191, 166, 0.1);
}

.language-option .flag {
    font-size: 20px;
}

.language-option .lang-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.language-option i {
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.language-option.active i {
    opacity: 1;
}

.language-option.active {
    background: rgba(0, 191, 166, 0.08);
}

/* Register Modal Specific */
#registerModal .modal-content {
    padding: 24px;
    width: 100%;
    max-width: 520px;
}

#registerModal.open {
    display: flex !important;
}

/* Login Modal Specific */
#loginModal .modal-content {
    padding: 24px;
    width: 100%;
    max-width: 500px;
}

#loginModal.open {
    display: flex !important;
}

/* Scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Toast Animations */
@keyframes slideUp {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    
    .topnav .inner {
        height: 58px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu {
        top: 58px;
        height: calc(100vh - 58px);
    }
    
    .task-mini {
        width: 160px;
        min-height: 130px;
    }
    
    .list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .language-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }
    
    .language-option {
        padding: 12px 14px;
    }
    
    .language-btn .current-lang {
        display: inline;
    }

    /* Hide auth buttons on mobile, show in header menu instead */
    .auth-buttons-header {
        display: none !important;
    }
    
    .chips {
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .modal {
        padding: 10px;
    }
    
    #registerModal .modal-content {
        padding: 20px;
        max-width: 100%;
    }
    
    #loginModal .modal-content {
        padding: 20px;
        max-width: 100%;
    }
}

.alert-danger {
    background-color: #9b1d1d;border-radius: 5px;padding: 10px;
}

@media (max-width: 900px) {

    .hide-mb-900 {
        display: none;
    }

}