:root {
    --primary-color: #6200ee;
    --primary-light: #bb86fc;
    --primary-dark: #3700b3;
    --secondary-color: #03dac6;
    --background: #121212;
    --surface: #1e1e1e;
    --surface-light: #2c2c2c;
    --error: #cf6679;
    --on-primary: #ffffff;
    --on-secondary: #000000;
    --on-background: #ffffff;
    --on-surface: #ffffff;
    --on-error: #000000;
    --sidebar-width: 280px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

/* Light theme variables */
[data-theme="light"] {
    --primary-color: #6200ee;
    --primary-light: #9e47ff;
    --primary-dark: #3700b3;
    --secondary-color: #03dac6;
    --background: #f5f5f5;
    --surface: #ffffff;
    --surface-light: #f0f0f0;
    --error: #b00020;
    --on-primary: #ffffff;
    --on-secondary: #000000;
    --on-background: #121212;
    --on-surface: #121212;
    --on-error: #ffffff;
}

/* General body styling */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-image: url("../pictures/background/based_bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--on-background);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}

/* Main content area */
main {
    width: 100%;
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
    position: relative;
}

/* Header bar styling */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    background-color: var(--surface);
    padding: 0 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--on-surface);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Content container */
.content-container {
    padding: 20px;
}

/* Sidebar styling */
.sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    background-color: var(--surface);
    overflow-x: hidden;
    transition: width var(--transition-speed);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    height: 40px;
    width: auto;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar a {
    padding: 12px 16px;
    text-decoration: none;
    font-size: 1rem;
    color: var(--on-surface);
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
    margin: 4px 8px;
    border-radius: 8px;
}

.sidebar a i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar a.active {
    background-color: var(--primary-color);
    color: var(--on-primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: var(--on-surface);
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.social-icons a {
    color: var(--on-surface);
    font-size: 1.2rem;
    margin: 0 8px;
    padding: 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: var(--on-primary);
}

/* Button styling */
.openbtn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--on-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.openbtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.closebtn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--on-surface);
    padding: 4px 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.closebtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* When sidebar is open */
.sidebar.open {
    width: var(--sidebar-width);
}

#main.shifted {
    margin-left: var(--sidebar-width);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }
    
    #main.shifted {
        margin-left: 0;
    }
    
    .sidebar.open {
        width: 100%;
    }
}

/* Ko-fi widget adjustments */
iframe.floatingchat-container {
    width: 360px;
}

/* Dark overlay when mobile sidebar is open */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.overlay.active {
    display: block;
}
