/* SVO Segeln Booking System Styles */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

.calendar-day:not(.booked):not(.blocked):not(.past):not(.empty):not(.no-access):hover {
    background-color: #ecfdf5; /* A light green */
    color: #065f46; /* A dark green */
    cursor: pointer;
    border-color: #10b981; /* A medium green */
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.weekend-holiday {
    background-color: #eff6ff; /* A light blue */
}

.calendar-day {
    min-height: 6.5rem !important; /* 96px - same as h-24 */
    max-height: 6.5rem !important; /* 96px - same as h-24 */
    height: 6.5rem !important; /* Force exact height */
    display: block !important;
    flex: none !important; /* Prevent flex growth */
}

/* Boote view: override height for combined boat view */
.calendar-day.h-boote-view {
    min-height: 7.5rem !important; /* 120px - tall enough for 3 small boat boxes */
    max-height: 7.5rem !important;
    height: 7.5rem !important;
    display: flex !important; /* Use flex layout for Boote view */
    flex-direction: column !important;
}

/* Candela view: taller cells to accommodate 5 bookers */
.calendar-day.h-candela-view {
    min-height: 7.5rem !important; /* 136px - tall enough for 5 bookers */
    max-height: 7.5rem !important;
    height: 7.5rem !important;
    display: block !important;
}

.calendar-day .font-bold {
    line-height: 1 !important; /* Tight spacing for day number */
    margin-bottom: 0.125rem !important; /* Minimal space below day number */
}

#calendar-grid {
    grid-auto-rows: 6.5rem !important; /* Force all grid rows to be 6.5rem */
}

/* Boote view: override grid row height */
#calendar-grid:has(.h-boote-view) {
    grid-auto-rows: 7.5rem !important; /* Tall rows for Boote view */
}

/* Candela view: override grid row height for 5 bookers */
#calendar-grid:has(.h-candela-view) {
    grid-auto-rows: 7.5rem !important; /* Tall rows for Candela view (5 bookers) */
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .calendar-day-mobile {
        min-height: 3.5rem;
        max-height: none !important;
        height: auto !important;
    }
    
    .calendar-day-mobile:not(.blocked):not(.past):not(.no-access):active {
        background-color: #ecfdf5;
        border-color: #10b981;
    }

    /* Ensure content has proper spacing from date column */
    .calendar-day-mobile .flex-grow {
        padding-left: 0.75rem; /* Additional left padding to prevent text from touching */
    }
    
    /* Boat tabs: fit 3 per row on mobile */
    #boat-tabs button {
        flex: 1 1 calc(33.333% - 0.5rem);
        min-width: 0;
    }
    
    /* Make Vereinsevents wrap to next line if needed */
    #boat-tabs button:nth-child(4) {
        flex-basis: 100%;
        margin-top: 0.25rem;
    }
    
    /* Calendar header: smaller icons and text on mobile */
    #calendar-title {
        font-size: 1.125rem;
    }
    
    #ical-copy-button {
        padding: 0.375rem;
    }
}

/* Button container layout */
.buttons-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
}

/* Mobile: stack buttons vertically, admin buttons first row, user buttons second row */
@media (max-width: 768px) {
    .buttons-container {
        flex-direction: column !important;
    }
    
    .buttons-container > div {
        width: 100%;
    }
    
    .buttons-container button,
    .buttons-container a {
        flex: 1;
    }
}

/* Reduce vertical spacing for welcome message section */
#welcome-message {
    margin-top: -0.75rem !important; /* Reduce top margin to bring closer to "Willkommen," */
    margin-bottom: +0.15rem !important; /* Remove bottom margin */
    line-height: 1.5rem !important; /* Tighter line height (default is 2rem for text-2xl) */
}

/* Reduce spacing below welcome message */
#welcome-message + p,
#welcome-message ~ p {
    margin-top: 0.25rem !important; /* Minimal spacing below welcome message */
}

#announcement-banner {
    margin-top: -0.75rem !important; /* Reduce top margin to bring closer to "Willkommen," */
    margin-bottom: -0.15rem !important; /* Remove bottom margin */
    line-height: 1.5rem !important; /* Tighter line height (default is 2rem for text-2xl) */
}

/* Remove underlines from footer links */
footer a {
    text-decoration: none !important;
}

footer a:hover {
    text-decoration: none !important;
}

/* Print styles for statistics modal */
@media print {
    /* Hide print button and close buttons */
    .no-print {
        display: none !important;
    }
    
    /* Hide modal backdrop */
    .modal-backdrop {
        display: none !important;
    }
    
    /* Ensure statistics modal is visible even if it has hidden class */
    #statistics-modal {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 9999 !important;
    }
    
    /* Remove overflow restrictions so all content prints */
    #statistics-modal .flex-1,
    #statistics-modal .overflow-y-auto {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }
    
    /* Remove overflow from member leaderboard container */
    #statistics-modal #member-leaderboard {
        overflow: visible !important;
    }
    
    /* Remove overflow from boat statistics container */
    #statistics-modal #boat-statistics {
        overflow: visible !important;
        display: block !important;
        grid-template-columns: none !important;
    }
    
    /* Ensure modal content container doesn't restrict height */
    #statistics-modal > div.bg-white {
        max-height: none !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-top: 1rem !important;
    }
    
    /* Ensure tables print properly with page breaks */
    #statistics-modal table {
        page-break-inside: auto !important;
        width: 100% !important;
    }
    
    #statistics-modal tr {
        page-break-inside: avoid !important;
    }
    
    /* Make sure all table content is visible */
    #statistics-modal tbody {
        display: table-row-group !important;
    }
    
    /* Prevent page breaks inside table headers */
    #statistics-modal thead {
        display: table-header-group !important;
    }
}