﻿:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --sidebar-width: 200px;
    --sidebar-collapsed-width: 65px;
}

/* Global Reset & Fonts */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto', sans-serif;
    background-color: #f5f7fa;
}

/* Header (Navbar) */
.header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 1030;
}

    .header .user-info {
        display: flex;
        align-items: center;
    }

        .header .user-info img {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }

    .header .menu-toggle {
        display: none;
        border: none;
        background: none;
        font-size: 1.5rem;
        color: white;
    }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    background-color: white;
    width: var(--sidebar-collapsed-width);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 1020;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    /* Expand on Hover */
    .sidebar:hover {
        width: var(--sidebar-width);
    }

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .sidebar-menu a {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        text-decoration: none;
        color: var(--dark);
        transition: background 0.2s ease;
        border-left: 3px solid transparent;
        white-space: nowrap;
    }

        .sidebar-menu a:hover,
        .sidebar-menu a.active {
            background-color: rgba(52, 152, 219, 0.1);
            color: var(--secondary);
            border-left-color: var(--secondary);
        }

        .sidebar-menu a i {
            margin-right: 12px;
            font-size: 1.1rem;
            min-width: 20px;
            text-align: center;
        }

        .sidebar-menu a span {
            display: none;
            transition: opacity 0.2s ease;
        }

.sidebar:hover .sidebar-menu a span {
    display: inline;
    opacity: 1;
}


/* Logout Button (desktop collapsed) */
.sidebar .btn-outline-danger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 500;
    width: 100%;
    border-left: 3px solid transparent;
    text-align: left;
    transition: all 0.3s ease;
}

    .sidebar .btn-outline-danger:hover {
        background-color: rgba(231, 76, 60, 0.1);
        border-left-color: var(--accent);
    }

    /* Hide logout text in collapsed state */
    .sidebar .btn-outline-danger span {
        display: none;
        transition: opacity 0.2s ease;
    }

.sidebar:hover .btn-outline-danger span {
    display: inline;
    opacity: 1;
}

.sidebar .btn-outline-secondary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--secondary);
    font-weight: 500;
    width: 100%;
    border-left: 3px solid transparent;
    text-align: left;
    transition: all 0.3s ease;
}

    .sidebar .btn-outline-secondary:hover {
        background-color: rgba(52, 152, 219, 0.1);
        border-left-color: var(--secondary);
    }

    /* Hide logout text in collapsed state */
    .sidebar .btn-outline-secondary span {
        display: none;
        transition: opacity 0.2s ease;
    }

.sidebar:hover .btn-outline-secondary span {
    display: inline;
    opacity: 1;
}

/* Main Content Area */
.content {
    margin-left: var(--sidebar-collapsed-width);
    padding-top: 15px;
    margin-top : 60px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 60px);
}

.sidebar:hover ~ .content {
    margin-left: var(--sidebar-width);
}

/* Clock container spacing */
#clock-container {
    font-weight: 500;
}

/* Responsive */

@media (max-width: 992px) {
    .sidebar .btn-outline-danger span,
    .sidebar-menu a span {
        display: inline !important;
        opacity: 1 !important;
    }
}


@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-width); /* show full sidebar on mobile toggle */
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .content {
        margin-left: 0 !important;
    }

    .sidebar:hover ~ .content {
        margin-left: 0 !important;
    }

    .sidebar .btn-outline-danger span,
    .sidebar-menu a span {
        display: inline !important;
        opacity: 1 !important;
    }

    .header .menu-toggle {
        display: block;
    }
}

/* Scrollbar styling (optional) */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}
