/* Dashboard specific styles */
@import url('../css/style.css');

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: var(--light);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow: hidden;
    left: 0;
    top: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .menu-link span {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .menu-link {
    justify-content: center;
    padding: 0.75rem;
}

[data-theme="dark"] .sidebar {
    background: var(--dark-surface);
}

.sidebar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}


.sidebar-brand span {
    color: var(--text-main);
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

.menu-link:hover,
.menu-link.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.1), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.menu-link i {
    width: 24px;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem;
    transition: var(--transition);
    min-width: 0;
    max-width: 100%;
}

.main-content.expanded {
    margin-left: 80px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    /* Reset global header styles */
    position: static;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    z-index: auto;
    height: auto;
    backdrop-filter: none;
}

[data-theme="dark"] .top-bar,
[data-theme="light"] .top-bar {
    background: transparent;
}

.search-bar {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 300px;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.logout-btn:hover {
    color: var(--primary) !important;
    transform: scale(1.1);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    font-size: 2rem;
    margin: 0;
    color: var(--text-main);
}

.stat-info p {
    margin: 0;
    font-size: 0.875rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Lists/Tables */
.table-container {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--light);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}

td {
    color: var(--text-main);
    vertical-align: middle;
}

.status {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.status.active,
.status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.status.pending,
.status.inprogress {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.status.inactive,
.status.cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 1rem 0;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-toggle-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle-btn {
        display: block;
    }

    .top-bar {
        gap: 1rem;
    }

    .top-bar h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        padding-top: 0.5rem;
    }

    .top-bar h2 {
        font-size: 1.4rem;
    }

    .user-profile {
        gap: 0.5rem;
    }

    .user-profile div {
        display: none;
    }

    .card {
        padding: 1.25rem;
    }

    .card h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 360px) {
    .main-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-info h3 {
        font-size: 1.25rem;
    }

    .stat-info p {
        font-size: 0.75rem;
    }

    .card {
        padding: 1rem;
    }

    .card h3 {
        font-size: 1.1rem;
    }
}

/* Task Management Enhancements */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-input {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--white);
    color: var(--text-main);
    font-size: 0.875rem;
    transition: var(--transition);
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    color: var(--text-muted);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

.action-btn.delete:hover {
    background: #EF4444;
}

tr.clickable-row {
    cursor: pointer;
    transition: var(--transition);
}

tr.clickable-row:hover {
    background: rgba(79, 70, 229, 0.02);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-main);
}

.task-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.detail-item p {
    font-size: 1rem;
    color: var(--text-main);
    margin: 0;
}

/* Settings Dropdown */
.menu-item {
    position: relative;
}

.settings-dropdown {
    display: none;
    position: absolute;
    left: calc(100% + 10px);
    bottom: -10px;
    width: 240px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 1rem;
    animation: slideIn 0.3s ease;
}

.settings-dropdown.active {
    display: block;
}

[data-theme="dark"] .settings-dropdown {
    background: var(--dark-surface);
}

.dropdown-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.dropdown-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-item {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: var(--transition);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--primary);
    color: var(--white-fixed);
}

.logout-container {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #EF4444;
    color: #ffffff;
    transform: translateX(3px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Adjustments for Settings Dropdown */
@media (max-width: 768px) {
    .settings-dropdown {
        left: 0;
        bottom: 50px;
        width: 100%;
        position: relative;
        left: 0;
        bottom: 0;
        margin-top: 0.5rem;
        box-shadow: none;
        border: 1px solid var(--border);
    }
}