/* 1. Base Setup for the entire window */
html, body {
    height: 100%;
    width: 100%;
    overflow: hidden; /* Disables the main browser scrollbar */
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #F8F9FA; /* This is the base background */
    position: relative; /* Establishes a positioning context */
}

/* 2. The Decorative Blobs */
body::before, body::after {
    content: '';
    position: fixed; /* Fixed position so they don't scroll */
    z-index: 0;      /* Places them on a base layer, above the background color */
    border-radius: 50%;
    filter: blur(100px); /* Creates the soft, cloud-like effect */
    opacity: 0.6;      /* Control the intensity */
}

/* Top-left purple blob */
body::before {
    width: 500px;
    height: 500px;
    top: -150px; /* Position it off-screen */
    left: -150px;
    background-color: #C7D2FE; /* A soft indigo/purple */
}

/* Bottom-right blue blob */
body::after {
    width: 600px;
    height: 600px;
    bottom: -200px; /* Position it off-screen */
    right: -200px;
    background-color: #BFDBFE; /* A soft blue */
}

/* 3. The Main App Container */
.app-container {
    position: relative; 
    z-index: 1; /* CRITICAL: Lifts all app content above the z-index: 0 blobs */
    display: flex;
    height: 100%;
    width: 100%;
    /* App container itself must be see-through */
    background: transparent; 
}

/* 4. Sidebar: Fixed width, never scrolls */
.sidebar {
    width: 90px;
    height: 100%;
    background-color: #FFFFFF;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    padding: 25px 0;
    box-sizing: border-box;
    transition: width 0.3s ease;
    flex-shrink: 0; /* Prevents it from shrinking */
}

.sidebar-logo {
    font-size: 28px;
    color: #4F46E5;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    height: 40px; /* Set a fixed height */
}
/* Hide the text by default */
.logo-text,
.link-text {
    display: none;
    white-space: nowrap;
}
.logo-text {
    font-size: 24px;
    font-weight: 700;
    margin-left: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.nav-link {
    font-size: 22px;
    color: #6B7280;
    padding: 12px 0;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the icon in collapsed state */
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
}
.nav-link .link-text {
    font-size: 16px;
    font-weight: 500;
    margin-left: 20px;
}
.nav-link i {
    min-width: 40px; /* Keep icons aligned */
    text-align: center;
}
.nav-link:hover {
    color: #4F46E5;
}
.sidebar-footer {
    margin-top: auto; /* Pushes footer to the bottom */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile-icon {
    font-size: 32px;
    color: #6B7280;
}

/* Buttons */
.btn {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: #111827;
    color: #FFF;
}

.btn-secondary {
    background-color: #FFFFFF;
    color: #1F2937;
    border-color: #D1D5DB;
}

/* --- Expanded Sidebar State --- */
.app-container.sidebar-expanded .sidebar {
    width: 300px;
}
/* Show the text when expanded */
.app-container.sidebar-expanded .logo-text,
.app-container.sidebar-expanded .link-text {
    display: inline;
}
/* Align items to the left when expanded */
.app-container.sidebar-expanded .sidebar-logo,
.app-container.sidebar-expanded .nav-link {
    justify-content: flex-start;
    padding-left: 25px;
}
.app-container.sidebar-expanded #sidebar-expander i {
    transform: rotate(180deg); /* Rotate the arrow icon */
}

.page-content.full-screen {
    padding: 0;
}


/* Main Content Styling */
.main-content {
    flex-grow: 1; /* Takes up the remaining space */
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* This is the ONLY vertical scrollbar */
    overflow-x: hidden; /* Prevents any horizontal scroll */
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}
.header-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.user-profile a {
    font-size: 45px;
    color: #6B7280;
}

.page-content {
    padding: 40px;
    flex-grow: 1; /* This tells it to fill all available vertical space */
    display: flex;
    flex-direction: column;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .page-content {
        padding: 0; /* Or even 0 for a true full-screen chat */
    }

    /* Make the sidebar slightly narrower on tablets/phones */
    .sidebar {
        width: 70px;
    }

    /* Hide the text and expander button to keep it icon-only */
    .app-container.sidebar-expanded .sidebar {
        width: 70px;
    }
    .app-container.sidebar-expanded .link-text,
    .app-container.sidebar-expanded .logo-text,
    #sidebar-expander {
        display: none;
    }
    .app-container.sidebar-expanded .sidebar-logo,
    .app-container.sidebar-expanded .nav-link {
        justify-content: center;
        padding-left: 0;
    }

    /* Reduce padding on the main content and header */
    .main-header {
        padding: 15px 20px;
    }
    .page-content {
        padding: 20px;
    }

    /* Adjust profile page for mobile */
    .profile-wrapper {
        flex-direction: column; /* Stack sidebar and main content */
        margin-top: 0;
        padding: 0;
    }
    .profile-sidebar {
        max-width: 100%;
    }
}