/**
 * Frontend Styles for TeamSnap Schedule Block
 */
.teamsnap-schedule-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.teamsnap-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    min-width: 180px;
}

.filter-group.checkboxes {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    width: 100%;
}

.filter-group.checkboxes label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #3498db;
    border-radius: 4px;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%, transparent 25%,
        transparent 50%, rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%, transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    animation: progress-bar-stripes 2s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 40px 0; }
    to { background-position: 0 0; }
}

#teamsnap-rest-schedule-results .error {
    color: #d9534f;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    padding: 15px;
    border-radius: 4px;
}

#teamsnap-rest-schedule-results .loading-message {
    text-align: center;
    color: #666;
    padding: 30px;
    font-size: 16px;
}

#teamsnap-rest-schedule-results table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#teamsnap-rest-schedule-results th,
#teamsnap-rest-schedule-results td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    font-size: 14px;
}

#teamsnap-rest-schedule-results th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: relative;
    padding-right: 30px;
}

#teamsnap-rest-schedule-results tr:nth-child(even) {
    background-color: #f9f9f9;
}

#teamsnap-rest-schedule-results tr:hover {
    background-color: #f1f1f1;
}

#teamsnap-rest-schedule-results .is-canceled {
    text-decoration: line-through;
    opacity: 0.7;
    background-color: #ffe5e5; 
}

#teamsnap-rest-schedule-results .date-header {
    background-color: #ffffff;
    color: #495057;
    font-weight: bold;
    font-size: large;
    text-align: center;
    padding: 10px 12px;
    border-left: none;
    border-right: none;
}

#teamsnap-rest-schedule-results .time-header {
    background-color: #e9ecef;
    color: #495057;
    padding: 8px 12px;
    font-weight: bold;
}

#teamsnap-rest-schedule-results .location-cell,
#teamsnap-rest-schedule-results .division-cell,
#teamsnap-rest-schedule-results .team-cell {
    cursor: pointer;
    color: #0073aa;
    text-decoration: underline;
}

#teamsnap-rest-schedule-results .location-cell:hover,
#teamsnap-rest-schedule-results .division-cell:hover,
#teamsnap-rest-schedule-results .team-cell:hover {
    color: #00a0d2;
}

/* --- Mobile Styles --- */
@media (max-width: 768px) {
    .teamsnap-filters {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group.checkboxes {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .teamsnap-schedule-table thead {
        display: none;
    }

    .teamsnap-schedule-table, 
    .teamsnap-schedule-table tbody, 
    .teamsnap-schedule-table tr, 
    .teamsnap-schedule-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .teamsnap-schedule-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .teamsnap-schedule-table td {
        border: none;
        border-bottom: 1px solid #eee;
        text-align: right;
        padding: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .teamsnap-schedule-table td:before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        padding-right: 15px;
    }

    .teamsnap-schedule-table td > * {
        max-width: 60%; /* Prevents long clickable names from pushing the label off-screen */
    }

    .date-header, .time-header {
        padding: 10px;
        text-align: center;
        border: none;
    }
    .date-header td, .time-header td {
        justify-content: center;
    }
     .date-header td:before, .time-header td:before {
        display: none;
     }
}