/* ========================================
   LAYOUT - Container, Header, Footer, Grids
   ======================================== */

/* Glassmorphism Container */
.container {
    max-width: min(1400px, 100vw);
    width: 100%;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 30px;
    box-shadow: var(--shadow-xl),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
    box-sizing: border-box;
}

/* Glow Effect on Container */
.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: rotateGlow 20s linear infinite;
    pointer-events: none;
}

/* Header with Neon Effect */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 1;
}

.header-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* left | center (logo) | right */
    align-items: center;
    min-height: 60px;
    margin-bottom: 20px;
    position: relative;
}

.header-nav-left {
    justify-self: start;
}

.header-nav-center {
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-nav-right {
    justify-self: end;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Slightly smaller logo within the nav row for balance */
.header-logo-nav {
    max-width: 180px;
    width: 100%;
    height: auto;
    margin: 0;
}

.header-nav-right .email-text {
    color: var(--text-secondary);
    font-size: 0.95em;
    font-weight: 500;
    margin: 0;
    padding: 0;
}

.header-logo {
    max-width: 320px;
    width: 100%;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
    animation: fadeInDown 0.8s ease-out;
    filter: drop-shadow(0 5px 3px rgba(102, 126, 234, 0.3));
}

.header h1 {
    font-size: 3.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -1px;
    text-shadow: none;
    animation: titlePulse 3s ease-in-out infinite;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.2em;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Content Sections with Glassmorphism */
.content {
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

.info-box {
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: none;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.info-box:hover {
    background: rgb(35, 35, 55);
    transform: translateY(-5px);
    box-shadow: 0 20px 8px rgba(0, 0, 0, 0.3);
}

.info-box h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 2em;
    font-weight: 700;
}

.info-box h2::before {
    content: '✨ ';
}

.info-box h3 {
    color: var(--accent-purple);
    margin: 25px 0 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.info-box ul {
    margin-left: 25px;
    margin-bottom: 20px;
}

.info-box li {
    margin: 12px 0;
    color: var(--text-secondary);
    font-size: 1.05em;
    line-height: 1.6;
}

.info-box li::marker {
    color: var(--accent-purple);
}

.note {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 20px;
    padding: 15px;
    background: rgba(159, 122, 234, 0.1);
    border-radius: 10px;
    border-left: 3px solid var(--accent-purple);
}

/* Footer */
.footer {
    text-align: center;
    /* Reduced margin to minimize blank space */
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-weight: 500;
}

.footer p {
    font-size: 17.5px;
    margin: 0;
    padding: 0;
}

.footer p:first-child {
    margin-bottom: 12px;
}

.footer a {
    color: #fbc0ff;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer a:hover {
    color: #ffffff;
    text-shadow: none;
}

.back-link {
    margin-top: 25px;
}

.back-link a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.back-link a:hover {
    color: var(--accent-pink);
    text-shadow: none;
}

/* Top Actions Bar */
.top-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

/* Section Header with Actions */
.section-header-with-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
}

.section-header-with-actions h1 {
    flex: 0 0 auto;
}

.section-header-with-actions > .btn:first-child,
.section-header-with-actions > a:first-child {
    position: absolute;
    left: 0;
}

.section-header-with-actions > .btn:last-child,
.section-header-with-actions > button:last-child {
    position: absolute;
    right: 0;
}

/* Split View Container */
.calendars-split-view {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    /* Increased min-height to fill more space and reduce blank area */
    min-height: 550px;
    /* Removed max-height to allow proper vertical auto-scaling */
}

/* Calendar Section Container */
.calendar-section-container {
    display: flex;
    flex-direction: column;
    backdrop-filter: none;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    /* Reduced excessive bottom padding to prevent overlaps */
    padding-bottom: 25px;
    overflow: visible;
    position: relative;
}

/* Fancy Section Titles */
.section-title-fancy {
    color: white;
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 3px rgba(102, 126, 234, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.section-title-fancy:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 6px 4px rgba(102, 126, 234, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.title-icon {
    font-size: 28px;
    filter: drop-shadow(0 3px 2px rgba(102, 126, 234, 0.6));
}

/* Scrollable Grid - Independent Scrolling */
.calendar-scrollable-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 10px;
    min-height: 0;
    /* Expanded max-height to fill more space and reduce blank area */
    max-height: calc(100vh - 350px);
    grid-auto-rows: max-content;  /* row height fits content */
    align-content: start;         /* don't stretch rows */
    align-items: start;           /* don't stretch items */
}

.calendar-scrollable-grid::-webkit-scrollbar {
    width: 8px;
}

.calendar-scrollable-grid::-webkit-scrollbar-track {
    background: rgb(35, 35, 55);
    border-radius: 10px;
}

.calendar-scrollable-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.calendar-scrollable-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
}

/* Visual Divider Between Sections */
.section-divider {
    width: 3px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(102, 126, 234, 0.5) 20%,
        rgba(159, 122, 234, 0.5) 50%,
        rgba(240, 147, 251, 0.5) 80%,
        transparent 100%);
    border-radius: 10px;
    align-self: stretch;
    position: relative;
    animation: dividerPulse 3s ease-in-out infinite;
}
