/* Season Summary Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.season-summary-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
}

.page-1-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.season-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-text {
    flex: 1;
    text-align: center;
}

.season-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.season-start-date {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

.help-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.help-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.help-toggle-btn.active {
    background: white;
    color: #11998e;
    border-color: white;
}

.main-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* Left Column: Divisions Panel */
.divisions-panel {
    flex: 0 0 400px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.divisions-panel::-webkit-scrollbar {
    width: 8px;
}

.divisions-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.divisions-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.divisions-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#divisions-content {
    min-height: 200px;
}

.division-card {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.division-card:hover {
    border-color: #11998e;
    box-shadow: 0 4px 8px rgba(17, 153, 142, 0.2);
    transform: translateY(-2px);
}

.division-card.active {
    border-color: #11998e;
    background: #e6f7f4;
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.division-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.caret-icon {
    font-size: 0.75rem;
    color: #6c757d;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    user-select: none;
    cursor: pointer;
    padding: 2px;
}

.division-card.expanded .caret-icon {
    transform: rotate(90deg);
}

.division-card.collapsed .caret-icon {
    transform: rotate(0deg);
}

.division-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0;
}

.division-card.expanded .division-content {
    max-height: 2000px;
    margin-top: 10px;
}

.division-card.collapsed .division-content {
    max-height: 0;
    margin-top: 0;
}

.division-name {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0;
    cursor: pointer;
    transition: color 0.3s ease;
    font-weight: 600;
    flex: 1;
}

.division-name:hover {
    color: #11998e;
}

.division-card.active .division-name {
    color: #11998e;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Mobile: Single column for teams */
@media (max-width: 768px) {
    .teams-grid {
        grid-template-columns: 1fr;
    }
}

.team-item {
    padding: 6px 8px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    color: #495057;
    font-size: 0.75rem;
    line-height: 1.2;
    min-height: 55px;
    height: 55px;
    max-height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    box-sizing: border-box;
}

.team-item:hover {
    border-color: #11998e;
    background: linear-gradient(135deg, #e6f7f4 0%, #d4f4e3 100%);
    color: #11998e;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(17, 153, 142, 0.2);
}

.team-item.active {
    border-color: #11998e;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(17, 153, 142, 0.4);
}

.no-teams {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Help Text */
.help-text {
    background: #e8f5e9;
    border-left: 4px solid #11998e;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #2c3e50;
}

.help-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.help-text strong {
    color: #11998e;
    font-weight: 600;
}

/* Right Column: Calendar Panel */
.calendar-panel {
    flex: 1 1 0;
    min-width: 620px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 0; /* Force flex to work properly */
}

.calendar-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
    padding: 40px;
    text-align: center;
    min-height: 400px;
}

.calendar-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: block;
}

/* Back button - hidden on desktop */
.back-btn {
    display: none;
}


/* Mobile Navigation Styles */
@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }
    
    .season-summary-container {
        position: relative;
        overflow: hidden;
        height: 100vh;
        padding: 0;
    }
    
    /* Page containers for mobile swipe */
    .page-1-container,
    .page-2-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        transition: transform 0.3s ease-in-out;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .page-1-container {
        transform: translateX(0);
        z-index: 1;
    }
    
    .page-1-container.hidden {
        transform: translateX(-100%);
    }
    
    .page-2-container {
        transform: translateX(100%);
        z-index: 2;
    }
    
    .page-2-container.active {
        transform: translateX(0);
    }
    
    /* Smaller header on mobile - 25% of original height */
    .season-header {
        padding: 8px 15px;
        margin-bottom: 0;
        border-radius: 0;
        flex-shrink: 0;
    }
    
    .season-header h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    
    .season-start-date {
        font-size: 0.75rem;
    }
    
    .help-toggle-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    /* Hide help text by default on mobile */
    .help-text {
        display: none !important;
        margin-bottom: 0;
        padding: 10px 15px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .help-text.show {
        display: block !important;
    }
    
    .division-name {
        font-size: 0.95rem;
    }
    
    .division-card {
        margin-bottom: 6px;
        padding: 6px 10px;
    }
    
    /* Main layout takes remaining space */
    .main-layout {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    /* Divisions panel on mobile - takes most of the space with proper scrolling */
    .divisions-panel {
        flex: 1;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        padding: 15px;
        padding-bottom: 70px; /* 20px original + 50px extra for iPhone scroll cutoff */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
    
    /* Hide desktop calendar panel on mobile */
    .page-2-desktop {
        display: none;
    }
    
    /* Calendar container on mobile - full viewport */
    .page-2-container {
        width: 100vw;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
    }
    
    /* Back button - visible on mobile when page 2 is active */
    .back-btn {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1000;
        background: white;
        border: 2px solid #11998e;
        color: #11998e;
        padding: 8px 16px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.9rem;
        font-weight: 500;
        align-items: center;
        gap: 6px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }
    
    .back-btn:hover {
        background: #11998e;
        color: white;
        box-shadow: 0 4px 8px rgba(17, 153, 142, 0.3);
    }
    
    .back-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Calendar iframe on mobile - full viewport with padding for back button */
    #calendar-iframe {
        width: 100%;
        height: 100%;
        border: none;
        display: block;
    }
    
    /* Adjust iframe content to account for back button - add padding to header area */
    #calendar-iframe {
        padding-top: 60px;
        box-sizing: border-box;
    }
}

/* Desktop: Hide mobile page-2-container completely */
@media (min-width: 769px) {
    .page-2-container {
        display: none !important;
    }
}

