@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Poppins:wght@400;500;600&display=swap');

:root {
    --sidebar-bg: #fff;
    --main-bg: #f4f6f9;
    --header-gradient: linear-gradient(90deg, rgba(168,78,206,1) 0%, rgba(100,88,218,1) 100%);
    --panel-header-bg: #4a5568;
    --panel-header-text: #fff;
    --teal-color: #4fd1c5;
    --dark-blue: #2d3748;
    --text-color: #4a5568;
    --border-color: #e2e8f0;
}

/* ===== NEW: ANIMATION KEYFRAMES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Hind Siliguri', sans-serif;
}

body {
    background-color: var(--main-bg);
}

body.sidebar-open {
    overflow: hidden;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ================== Sidebar Styles ================== */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: margin-left 0.3s ease;
}

.sidebar-header {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    max-width: 90%; 
    height: auto;
}

.profile-section {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.profile-section h3 {
    font-size: 1rem;
    color: var(--dark-blue);
}

.profile-section p {
    font-size: 0.8rem;
    color: #a0aec0;
}

.quick-actions {
    display: flex;
    justify-content: space-around;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.icon-btn {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.icon-btn:hover {
    color: var(--dark-blue);
}

.main-nav ul {
    list-style: none;
    padding: 15px 10px;
}

.main-nav li {
    padding: 0;
}

.main-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 5px;
    font-size: clamp(0.85rem, 2.5vw, 0.9rem);
    transition: background-color 0.2s, color 0.2s, transform 0.2s ease-out;
}

.main-nav li.active a {
    background: linear-gradient(90deg, #4c66e0, #814ac6);
    color: white;
}

/* ===== UPDATED: HOVER ANIMATION ===== */
.main-nav li:not(.active) a:hover {
    background: #f0f0f7;
    color: var(--dark-blue);
    transform: translateX(5px);
}


.main-nav i {
    font-size: 1.1rem;
    margin-right: 15px;
    width: 20px;
    text-align: center;
    color: #a0aec0;
}

.main-nav li a:not(:has(i)) {
    padding-left: 25px;
}

/* ================== Main Content Styles ================== */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
    background: var(--header-gradient);
    color: white;
}

.main-header h2 {
    font-size: 1.5rem;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
}

#menu-toggle {
    color: white;
    font-size: 1.5rem;
    display: none;
}

.action-btn-green {
    background-color: var(--teal-color);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    margin-left: 10px;
    transition: background-color 0.2s, transform 0.2s ease;
}
.action-btn-green:hover {
    background-color: #38b2ac;
    transform: scale(1.05);
}

.content-area {
    padding: 25px;
    flex-grow: 1;
    background-color: #f0f0f7;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    animation: fadeInUp 0.5s 0.1s ease-out backwards;
}

.content-header h3 {
    color: var(--header-gradient);
    font-size: 1.2rem;
    background: -webkit-linear-gradient(90deg, rgba(168,78,206,1) 0%, rgba(100,88,218,1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0; 
}

/* Wrapper for content header buttons */
.content-header-actions-wrapper {
    display: flex;
}

/* Hide the JS-injected button by default */
.mobile-action-btn {
    display: none;
}

.filter-bar {
    display: flex;
    align-items: center;
    background-color: var(--panel-header-bg);
    padding: 8px;
    border-radius: 5px;
    animation: fadeInUp 0.5s 0.2s ease-out backwards;
}
.date-picker {
    background-color: white;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 3px;
    margin-right: 10px;
}
.date-picker i {
    color: var(--text-color);
    margin-right: 8px;
}
.date-picker input[type="text"] {
    border: none;
    outline: none;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    width: 90px;
    background: transparent;
}
.search-btn, .refresh-btn {
    border: none;
    padding: 7px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1rem;
    color: white;
    transition: transform 0.2s ease;
}
.search-btn:hover, .refresh-btn:hover {
    transform: scale(1.1);
}
.search-btn {
    background-color: #3182ce;
    margin-left: auto;
}
.refresh-btn {
    background-color: #e53e3e;
    margin-left: 5px;
}

/* ================== Dropdown Styles ================== */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.dropdown-btn img {
    height: 40px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.dropdown-btn:hover img {
    transform: scale(1.1);
}

.dropdown-content {
    display: block;
    position: absolute;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    right: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown-content a {
    color: var(--dark-blue);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-family: 'Hind Siliguri', sans-serif;
    font-weight: 500;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ================== Responsive Styles ================== */
@media (max-width: 992px) {
    .sidebar {
        margin-left: -260px;
        position: fixed;
        z-index: 1000;
        height: 100%;
        overflow-y: auto;
    }
    .sidebar.toggled {
        margin-left: 0;
    }
    #menu-toggle {
        display: block;
    }
    .main-header h2 {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-right {
        display: none;
    }
    .main-header {
        justify-content: flex-start;
        position: relative;
    }
    .main-header h2 {
        display: block;
        /* These properties are already set in the main class */
        font-size: 1.2rem;
    }
    .content-area {
        padding: 15px;
    }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .dropdown-content {
        left: 0;
    }
    .content-header-actions-wrapper {
        display: flex;
        align-items: stretch; /* THIS IS THE FIX: forces both buttons to the same height */
        gap: 10px;
        width: 100%;
    }
    .mobile-action-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        padding: 0 12px;
        border-radius: 8px;
        margin-left: 0;
    }
}