:root {
    --primary-color: #8b7fb8;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #ffffff;
    --dark-color: #343a40;
    --sidebar-width: 60px;
    --sidebar-transition-duration: 0.3s;
    --text-fade-duration: 0.2s;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--body-bg);
    color: var(--text-primary);
    transition: background-color var(--transition-theme), color var(--transition-theme);
    overflow-x: hidden;
    min-width: 480px;
}

.side-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--sidebar-bg);
    z-index: 1040;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 15px 10px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-logo img {
    height: 30px;
    width: auto;
    transition: opacity 0.3s ease;
}

.sidebar-logo img:hover {
    opacity: 0.8;
}

.sidebar-section {
    padding: 15px 0;
    width: 100%;
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
    min-height: 50px;
    box-sizing: border-box;
    background: transparent;
    width: 100%;
    margin: 2px 0;
}

.sidebar-item:hover,
.sidebar-item.active {
    background-color: var(--primary-selection);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-item.active {
    background-color: rgba(139, 127, 184, 0.2);
}

.sidebar-item-icon {
    width: 20px;
    height: 20px;
    text-align: center;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4px;
}

.sidebar-item-text {
    font-size: var(--font-size-xs);
    text-align: center;
    line-height: 1.2;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar-separator {
    height: 1px;
    background-color: var(--border-gray);
    margin: 10px 15px;
    width: calc(100% - 30px);
}

.sidebar-theme-toggle {
    margin-top: auto;
    padding: 15px 0;
    border-top: 1px solid var(--border-gray);
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-large);
    flex-shrink: 0;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    position: relative;
}

.content-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-large);
    padding: 30px;
    margin-bottom: 30px;
    transition: background-color var(--transition-theme), box-shadow var(--transition-theme);
}

.side-toolbar::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.side-toolbar::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.side-toolbar::-webkit-scrollbar-thumb {
    background: rgba(139, 127, 184, 0.3);
    border-radius: 3px;
}

.side-toolbar::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 127, 184, 0.5);
}

/* ===== USER AVATAR STYLES ===== */
.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
}

/* ===== CREDIT DISPLAY STYLES ===== */
.credits-display {
    cursor: default;
    color: var(--text-secondary);
    border-left-color: transparent;
}

.credits-display:hover {
    background-color: transparent;
    color: var(--text-primary);
    border-left-color: transparent;
}

.credits-display .sidebar-item-icon {
    color: var(--warning-color);
}

.credits-display .sidebar-item-text {
    font-weight: var(--font-weight-medium);
}

/* ===== MOBILE SIDEBAR TOGGLE ===== */
.sidebar-toggle-btn {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 15px;
        left: 15px;
        z-index: 1041;
        width: 44px;
        height: 44px;
        background-color: var(--sidebar-bg);
        border: 1px solid var(--border-gray);
        border-radius: var(--radius-medium);
        color: var(--text-primary);
        font-size: 24px;
        cursor: pointer;
        box-shadow: var(--shadow-large);
        transition: var(--transition-normal), left 0.3s ease-in-out;
    }

    .sidebar-toggle-btn.active {
        left: calc(15px + var(--sidebar-width));
    }

    .sidebar-toggle-btn:hover {
        background-color: var(--primary-selection);
        color: var(--primary-color);
    }

    .side-toolbar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .side-toolbar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-large);
    }

    .main-content {
        margin-left: 0;
    }
}

.main-content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1039;
    transition: opacity 0.3s var(--transition-theme);
}

/* ===== PAGE INACTIVITY OVERLAY ===== */
.page-inactivity-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-inactivity-overlay.show {
    opacity: 1;
}

.page-inactivity-modal {
    background: var(--card-bg);
    border-radius: var(--radius-large);
    padding: 0;
    box-shadow: var(--shadow-large);
    max-width: 450px;
    width: 90%;
    margin: 20px;
    border: 1px solid var(--border-gray);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.page-inactivity-overlay.show .page-inactivity-modal {
    transform: scale(1);
}

.page-inactivity-content {
    padding: 30px;
    text-align: center;
}

.page-inactivity-icon {
    font-size: 48px;
    color: var(--warning-color);
    margin-bottom: 20px;
}

.page-inactivity-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 15px 0;
}

.page-inactivity-message {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 25px 0;
}

.page-inactivity-actions {
    display: flex;
    justify-content: center;
}

.page-inactivity-actions .btn {
    min-width: 160px;
    padding: 12px 24px;
    border-radius: var(--radius-medium);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    transition: all 0.2s ease;
}

.page-inactivity-actions .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-inactivity-actions .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}
