/* ===== Global site.css (safe, global rules) ===== */

/* Body & base */
body {
    background-color: #ffffff;
    color: #333333;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #BAE6FD;
    position: fixed;
    top: 0;
    left: 0; /* fixed from 10 */
    z-index: 900;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.app-name {
    font-size: 1.5rem;
    color: #1E3A8A;
    margin: 0;
}

.auth-links {
    display: flex;
    gap: 15px;
}

.auth-link {
    color: #1E3A8A;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}

    .auth-link:hover {
        color: #60A5FA;
    }

/* Side Panel Menu */
.side-panel {
    position: fixed;
    top: 60px; /* below header */
    left: -250px;
    width: 250px;
    height: calc(100% - 60px);
    background-image: url('/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #8B5CF6; /* fallback */
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    transition: left 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

    .side-panel.active {
        left: 0;
    }

    /* Menu lists */
    .side-panel ul {
        list-style: none;
        padding: 20px;
        margin: 0;
    }

    .side-panel li {
        border-bottom: 1px solid #BAE6FD;
    }

/* Folder toggles */
.folder-toggle, .sub-folder-toggle {
    background: rgba(255,255,255,0.6);
    border: none;
    width: 100%;
    text-align: left;
    padding: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, color 0.2s;
    position: relative !important; /* avoid interfering with accordions */
}

.folder-toggle {
    color: #1E3A8A;
}

.sub-folder-toggle {
    color: #ffffff;
    padding-left: 30px;
}

    .folder-toggle:hover,
    .sub-folder-toggle:hover {
        background-color: #60A5FA;
        color: #ffffff;
    }

.folder-toggle .toggle-icon {
    color: #1E3A8A;
    transition: transform 0.2s, color 0.2s;
}

.sub-folder-toggle .toggle-icon {
    color: #ffffff;
    transition: transform 0.2s, color 0.2s;
}

.folder-toggle[aria-expanded="true"] .toggle-icon,
.sub-folder-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* Sub menus */
.sub-menu, .sub-sub-menu {
    display: none;
    padding-left: 0;
}

    .sub-menu.active, .sub-sub-menu.active {
        display: block;
    }

.side-panel .nav-link, .side-panel .sub-link, .side-panel .sub-sub-link {
    display: block;
    padding: 15px;
    font-size: 1.1rem;
    text-decoration: none;
    background: rgba(255,255,255,0.6);
    transition: background-color 0.2s, color 0.2s;
    color: #6D28D9;
}

.side-panel .sub-link {
    padding-left: 45px;
}

.side-panel .sub-sub-link {
    padding-left: 60px;
}

    .side-panel .nav-link:hover, .side-panel .sub-link:hover, .side-panel .sub-sub-link:hover {
        background-color: #60A5FA;
        color: #ffffff;
    }

/* Toggle button */
.menu-toggle {
    position: fixed;
    top: 75px;
    left: 15px;
    background: rgba(255,255,255,0.8);
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 5px;
    border-radius: 5px;
    font-size: 1.2rem;
    color: #1E3A8A;
    transition: color 0.2s, background 0.2s;
    width: 34px;
    height: 34px;
}

    .menu-toggle.active i {
        display: none;
    }

    .menu-toggle:hover {
        color: #60A5FA;
        background: rgba(255,255,255,1);
    }

/* Main content below header; shift when side panel open using sibling selector */
.main-content {
    padding: 20px;
    min-height: calc(100vh - 60px - 60px);
    margin-left: 0;
    margin-top: 60px; /* header height */
    transition: margin-left 0.3s ease-in-out;
}

.side-panel.active ~ .main-content {
    margin-left: 250px;
}

/* Content wrapper */
.content-wrapper {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    margin-left: 0;
    margin-right: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Footer */
.footer {
    background: #ffffff;
    padding: 10px 0;
    position: relative;
    bottom: 0;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
}

    .footer a {
        color: #60A5FA;
    }

/* Typographic baseline */
h1, h2, h3, h4, h5, h6, p, a {
    color: #333333;
}

/* Calendar libs defaults (global-safe) */
#calendar {
    max-width: 1100px;
    margin: 40px auto;
}

.tui-full-calendar-month, .tui-full-calendar-week, .tui-full-calendar-day {
    background-color: white;
    border: 1px solid #e5e5e5;
}

.tui-full-calendar-schedule {
    cursor: pointer;
    border-radius: 5px;
}

.modal-content {
    border-radius: 10px;
}

.modal-header {
    background-color: #f8f9fa;
}

.btn-primary {
    background-color: #3788d8;
    border-color: #3788d8;
}

/* Wide container helper */
.wide-1800 {
    max-width: 1800px;
    padding-left: 1px;
}

.main-content .container-xl.wide-1800 > h1:first-child,
.main-content .container-xl.wide-1800 > h2:first-child,
.main-content .container-xl.wide-1800 > h3:first-child {
    margin-left: 25px;
    position: relative;
}

/* Accordion tweaks (non-destructive; do not force important) */
.accordion-button {
    font-weight: 600;
}

    .accordion-button:focus {
        z-index: 3;
        border-color: #86b7fe;
        outline: 0;
        box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.25);
    }

.accordion-item {
    border: 1px solid rgba(0,0,0,.125);
}
/* Do NOT override .accordion-collapse transition with !important */


/* ===== Index page specific (scoped under #index-root) ===== */

/* Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#index-root .animate-header {
    animation: fadeInDown 1s ease-in-out;
}

/* Cards & lists */
#index-root .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-height: none;
}

    #index-root .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.2) !important;
    }

#index-root .list-group-item {
    padding: 0.4rem 0;
}

#index-root .card-header {
    font-weight: 600;
    border-bottom: none;
}

#index-root .card-body {
    border-radius: 0 0 0.375rem 0.375rem;
}

#index-root .compact-card-body {
    padding: 0.6rem;
}

#index-root .ultra-compact-card-body {
    padding: 0.4rem;
}

#index-root .badge {
    font-size: 0.85rem;
}

#index-root .progress-bar {
    font-weight: 500;
    font-size: 0.75rem;
}

/* Index container sizing (scoped) */
#index-root .container {
    width: 1200px !important;
    max-width: 1200px !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    flex: 1;
}

#index-root .content-wrapper {
    max-width: 1200px !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    flex: 1;
}

/* Responsive */
@media (max-width: 1200px) {
    #index-root .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    #index-root .content-wrapper {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    #index-root .card {
        margin-bottom: 0.5rem;
    }

    #index-root .display-4 {
        font-size: 1.6rem;
    }

    #index-root .progress {
        margin-bottom: 0.4rem;
    }
}

/* RSS section specifics (scoped) */
#index-root .accordion-body .list-group-item {
    padding: 1rem;
}

    #index-root .accordion-body .list-group-item:last-child {
        border-bottom: none;
    }
