﻿/* #region General*/
.page {
    display: grid;
    height: auto;
    background-color: #202020; /* Dark mode page background */
    grid-template-rows: 3.75rem /* header height by content */
    1fr /* content grows */
    auto; /* footer height by content */
    grid-template-columns: 18rem /* sidebar fixed width */
    1fr; /* main fills rest */
    grid-template-areas:
        "header  header"
        "sidebar main"
        "sidebar  footer";
}

    .page.hide-sidebar {
        grid-template-areas:
            "header  header"
            "main main"
            "footer  footer";
    }

.content-wrapper {
    flex: 1; /* push footer to bottom */
    display: flex; /* sidebar + main sit side by side */
    position: relative; /* for mobile off-canvas positioning */
}
/* #endregion*/

/* #region Header*/
.header-section {
    display: flex;
    align-items: center;
    position: fixed;
    padding: 0.625rem 1.25rem;
    background-color: #242424; /* Dark header-section */
    color: #E0E0E0; /* Light text */
    position: fixed;
    top: 0;
    width: 100%;
    height: 3.75rem;
    z-index: 1100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add shadow for depth */
    grid-area: header;
}

.header-section-logo {
    display: flex;
    align-items: center;
}

    .header-section-logo img {
        height: 2.5rem;
    }

.hamburger-icon {
    font-size: 1.5rem;
}

.header-section-auth {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    align-items: center; /* Center align */
    gap: 1rem; /* Add spacing between buttons */
    margin-top: 2rem; /* Add some space at the top */
}

    /* Button Styling */
    .header-section-auth .login-btn,
    .header-section-auth .signup-btn {
        width: 80%; /* Make buttons wider for better touch experience */
        padding: 0.75rem 1rem; /* Add more padding for mobile */
        font-size: 1rem; /* Increase font size for readability */
        border-radius: 0.5rem; /* Make buttons more rounded */
        text-align: center; /* Center text alignment */
        transition: all 0.3s ease; /* Smooth hover effect */
    }

    /* Login button specific styling */
    .header-section-auth .login-btn {
        background-color: #4A90E2; /* Blue for login */
        color: #fff;
        font-weight: bold;
    }

        .header-section-auth .login-btn:hover {
            background-color: #2A6DB5; /* Darker blue on hover */
            transform: scale(1.05); /* Subtle scale effect */
        }

    /* Sign-up button specific styling */
    .header-section-auth .signup-btn {
        background-color: #6C757D; /* Neutral slate blue */
        color: #fff;
        font-weight: bold;
    }

        .header-section-auth .signup-btn:hover {
            background-color: #5A636E; /* Darker slate blue on hover */
            transform: scale(1.05); /* Subtle scale effect */
        }

.header-dropdown-menu {
    position: absolute;
    display: block;
    top: 100%;
    left: auto;
    right: 0;
    width: 100%;
    background-color: #242424;
    border: 1px solid #444444;
    border-radius: 0.3rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    padding: 0.3rem;
    z-index: 1200;
    min-width: 8rem;
}

.header-dropdown-item {
    background: none;
    color: #E0E0E0;
    border: none;
    padding: 0.3rem 0.4rem;
    text-align: left;
    width: 100%;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

    .header-dropdown-item:hover {
        background-color: #3A3A3A;
        color: #E0E0E0;
    }

/* Username Dropdown */
.username-dropdown-container {
    position: relative;
    display: inline-block;
    outline: none; /* Remove focus outline */
}

.username-btn {
    background-color: transparent;
    color: #E0E0E0;
    font-weight: bold;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.arrow-down {
    font-size: 0.6rem;
    color: #A0A0A0;
}
/* #endregion*/

/* #region Main Content*/
main.main-content {
    flex-grow: 1;
    min-height: 100vh;
    height: auto;
    grid-area: main;
    overflow-y: auto;
}

    main.main-content.modal-open {
        filter: brightness(0.7); /* Darken the main page content */
        transition: filter 0.5s ease;
    }

article.content.px-4 {
    padding: 1.25rem;
    border-radius: 0.5rem;
    color: #E0E0E0; /* Light text */
    padding-right: 3rem !important;
    padding-left: 3rem !important;
    padding-top: 2rem !important;
}
/* #endregion*/

/* #region Sidebar*/
.sidebar {
    width: 18rem;
    background-color: #242424; /* Match header-section */
    position: fixed;
    top: 3.75rem;
    left: 0;
    height: 100%;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    grid-area: sidebar;
    padding: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 2rem;
    color: #2F4F4F;
    cursor: pointer;
    margin-right: auto;
    margin-left: 1rem;
}

/* Sidebar behavior for mobile */
.sidebar-mobile-open {
    transform: translateX(0);
}

.sidebar-mobile-closed {
    transform: translateX(-100%);
}

.sidebar-closed{
    display:none;
}

.sidebar-content {
    margin-top: 1rem;
}

.profile-section {
    margin-bottom: 0.5rem;
}

.profile-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 0.25rem;
    background-color: #202020; /* Dark gray background */
    color: #E0E0E0; /* Light text */
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 0.2rem;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    text-align: left;
}

    .profile-button:hover {
        background-color: #3A3A3A;
    }

.profile-arrow {
    margin-left: 0.5rem;
    font-size: 0.65rem; /* Slightly smaller arrow */
    opacity: 0.8; /* Subtle fade */
}

.no-profiles {
    margin: 1rem 0;
    font-style: italic;
    color: #888888;
}

.social-media-buttons.child {
    /* Collapsed state */
    max-height: 0; /* Slide from 0 height */
    overflow: hidden; /* Hide content when collapsed */
    opacity: 0; /* Fully transparent when collapsed */
    margin: 0; /* Remove vertical margin to avoid jump */
    padding-left: 1rem; /* Indent remains for styling */
    border-left: 2px solid #2A2A2A;
    /* The transitions we want to animate:
       - max-height for the sliding effect
       - opacity for the fade
       - margin for a smooth top/bottom spacing change
    */
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin 0.3s ease-out;
}

    /* Expanded state */
    .social-media-buttons.child.expanded {
        max-height: 500px; /* Large enough to show all content; adjust if needed */
        opacity: 1; /* Fully visible */
        margin-top: 0.4rem;
        margin-bottom: 0.4rem;
    }

/* You can keep using your existing .social-button styles from your code 
   or override them slightly if you want a smaller button in the nested area. */
.social-button {
    display: flex;
    align-items: center;
    padding: 0.7rem;
    margin-bottom: 0.3rem;
    background-color: #242424;
    color: #E0E0E0;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 0.2rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    text-align: left;
    width: 90%; /* Slightly narrower for nested look */
}

    .social-button:hover {
        background-color: #3A3A3A;
    }

    .social-button.selected {
        background-color: #3A3A3A;
    }

    .social-button.main-dashboard {
        text-align: center; /* Override the left align */
        justify-content: center; /* Center icon + text horizontally */
        width: 100%;
    }

.social-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

    .social-icon.main-icon {
        margin-right: 0.5rem;
    }

.add-profile-button {
    /* Similar style but distinct color or border to stand out */
    margin-top: 1.5rem; /* push to bottom if you want it at the bottom of the sidebar */
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
    font-weight: bold;
    color: #FFFFFF;
    background-color: #66B2FF; /* Vibrant blue */
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
    box-shadow: 0 0.5px 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

    .add-profile-button:hover {
        background-color: #1A73E8; /* Hover shade of blue */
    }

    .add-profile-button:active {
        background-color: #1E4E7A; /* Active shade of blue */
        transform: translateY(0);
    }

.profile-arrow img {
    /* start “pointing down” */
    transform: rotate(0deg);
    transform-origin: center;
    transition: transform 0.3s ease;
}

    .profile-arrow img.flip-image {
        /* when open, flip 180° */
        transform: rotate(180deg);
    }
/* #endregion*/

/* #region Footer*/
.footer-section {
    background-color: #242424;
    color: #E0E0E0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* shadow casting upward */
    position: relative;
    z-index: 1100;
    flex-shrink: 0;
    padding: 2rem 1rem 1rem; /* extra top padding */
    grid-area: footer;
}

/* Inner columns wrapper */
.footer-section-container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: space-between;
}

/* Each column */
.footer-section-column {
    flex: 1 1 200px; /* grow/shrink, min 200px */
    margin: 0.5rem;
}

    .footer-section-column h4 {
        margin-bottom: 0.75rem;
        font-size: 1rem;
        font-weight: bold;
    }

    .footer-section-column ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .footer-section-column li {
        margin-bottom: 0.5rem;
    }

    .footer-section-column a {
        color: #E0E0E0;
        text-decoration: none;
    }

        .footer-section-column a:hover {
            text-decoration: underline;
        }

/* Social links as inline list */
.social-links {
    display: flex;
    gap: 0.75rem;
}

/* Bottom bar */
.footer-section-bottom {
    margin: 1.5rem auto 0;
    text-align: center;
    font-size: 0.75rem;
    border-top: 1px solid #444444;
    padding-top: 1rem;
}
/* #endregion*/

/* #region Desktop overrides*/
@media (min-width: 769px) {
    .mobile-only,
    .sidebar-toggle,
    .header-section-auth {
        display: none;
    }

    main.only-main {
        margin-left: 20rem;
        margin-right: 20rem;
    }

    .desktop-only {
        display: flex; /* Show desktop-only buttons in the header */
    }

    .header-section {
        justify-content: flex-start;
    }

    .header-section-logo {
        margin-right: auto;
    }

    .sidebar {
        transform: translateX(0);
        position: fixed;
        height: calc(100% - 3.75rem);
        top: 3.75rem;
    }
}
/* #endregion*/

/* #region Mobile overrides*/
@media (max-width: 768px) {
    .footer-section-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-section-column {
        margin: 0.75rem 0;
    }

    article.content.px-4 {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
        padding-top: 1rem !important;
        padding-bottom: 5rem !important;
    }

    .page {
        /* collapse to a single 1fr column instead of 18rem 1fr */
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "header"
            "main"
            "footer";
        overflow-x: hidden; /* prevent any horizontal scroll */
    }

    .main-content {
        /* ensure full-width, no leftover margins */
        width: 100%;
        height: auto;
    }

    /* keep header above everything */
    .header-section {
        position: relative;
        z-index: 1100;
        justify-content: flex-end;
    }

    .sidebar {
        position: fixed;
        top: 3.75rem; /* sit right under the header */
        bottom: 0; /* all the way down, so it covers footer */
        left: 0;
        width: 18rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000; /* above main and footer, below header */
    }

    .sidebar-mobile-open {
        transform: translateX(0) !important;
    }

    .sidebar-mobile-closed {
        transform: translateX(-100%) !important;
    }

    .mobile-only {
        display: flex;
    }

    .desktop-only {
        display: none;
    }

    .header-section-logo {
        margin-left: auto;
    }

    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }

    .header-section-auth {
        display: flex; /* Show login/signup buttons in the sidebar for mobile view */
    }
}
/* #endregion*/
