/* static/css/theme.css */

/* -- Layout -- */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* -- Sidebar -- */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 50;
}

/* -- Brand Logo (Heavy UI) -- */
.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(rgba(255, 255, 255, 0.25), transparent);
    transform: rotate(45deg);
}

.brand-icon .material-symbols-outlined {
    font-size: 24px;
    font-variation-settings: 'FILL' 1, 'wght' 700;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 900;
    font-size: 1.45rem;
    line-height: 1;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.brand-subtitle {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.sidebar-header {
    height: 76px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    font-size: 22px;
    margin-right: 14px;
    transition: color 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--accent-gradient-glow);
    color: var(--accent-primary);
    transform: translateX(6px);
}

.nav-item.active {
    background: linear-gradient(90deg, #4f46e5, #ec4899, #8b5cf6, #3b82f6, #4f46e5);
    background-size: 300% 300%;
    animation: logo-shimmer 4s linear infinite;
    color: white;
    box-shadow: 0 4px 12px var(--accent-gradient-glow);
}

.nav-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    color: white !important;
}

/* -- Main Content -- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    height: 46px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 40;
}

[data-theme="dark"] .topbar {
    background-color: rgba(24, 24, 27, 0.8);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.content-wrapper {
    padding: 16px 28px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

/* -- Cards -- */
.card {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary-hover);
}

.card:hover::before {
    opacity: 1;
}

/* -- Auth Layout -- */
.auth-container {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
    overflow: hidden;
}

.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 10;
}

.auth-right {
    flex: 1;
    background: var(--accent-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 900px) {
    .auth-right {
        display: none;
    }
}

.auth-right::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(80px);
    top: -200px;
    right: -200px;
    animation: float 10s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(30px);
    }
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
    backdrop-filter: blur(12px);
}

/* -- Forms & Inputs -- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px var(--accent-gradient-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-gradient-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}
}

/* -- Utilities -- */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-8 {
    margin-bottom: 32px;
}

.mt-4 {
    margin-top: 16px;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* -- Global Modal Scroll (applies to every page) -- */
.modal-overlay {
    overflow-y: auto !important;
    align-items: flex-start !important;
    padding: 40px 16px !important;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary, #6366f1) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

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

.modal-content::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary, #6366f1);
    border-radius: 10px;
}


/* -- Responsive -- */
.mobile-only {
    display: none !important;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex !important;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar {
        padding: 0 16px;
    }


    .content-wrapper {
        padding: 16px;
    }

    .topbar-actions {
        gap: 8px;
    }

    .view-switcher,
    .task-toolbar {
        flex-wrap: wrap;
    }

    .view-switcher {
        justify-content: space-between;
    }

    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Global Modal and Form responsiveness */
    .modal-content {
        padding: 20px 16px !important;
        width: 95% !important;
    }

    .form-row {
        flex-direction: column !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
    }

    .form-row>.form-group {
        width: 100% !important;
    }

    /* Clean up Filter Toolbars */
    .project-filters {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .project-filters>button,
    .project-filters>select,
    .project-filters>div {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .view-switcher>div {
        margin-left: 0 !important;
        width: 100%;
        justify-content: flex-start;
    }
}

/* -- Global Loader -- */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}