/* ============================================
   SCHEDULED EVENTS STYLES
   Recurring event scheduling and display
   ============================================ */

/* --------------------------------------------
   NEXT SCHEDULED EVENT IN HEADER
   Compact next event display
   -------------------------------------------- */
.next-scheduled-event h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.next-scheduled-event-card {
    background: var(--dark-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.next-scheduled-event-card:hover {
    background: var(--hover-bg);
    border-color: white;
    transform: translateY(-2px);
}

.next-event-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.next-event-header i {
    font-size: 0.75rem;
    color: var(--stockton-blue);
}

.next-event-header h4 {
    font-size: 0.65rem;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.next-event-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.next-event-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.next-event-time i {
    font-size: 0.6rem;
}

.next-event-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.next-event-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.next-event-date i {
    font-size: 0.6rem;
}

/* Next event type badges */
.next-event-type {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    align-self: flex-start;
}

.next-event-type.tournament {
    background: rgba(167, 139, 250, 0.2);
    color: rgba(167, 139, 250, 1);
}

.next-event-type.match {
    background: rgba(252, 165, 165, 0.2);
    color: rgba(252, 165, 165, 1);
}

.next-event-type.practice {
    background: rgba(134, 239, 172, 0.2);
    color: rgba(134, 239, 172, 1);
}

.next-event-type.event {
    background: rgba(147, 197, 253, 0.2);
    color: rgba(147, 197, 253, 1);
}

.next-event-type.misc {
    background: rgba(250, 204, 21, 0.2);
    color: rgba(250, 204, 21, 1);
}

/* Empty state for next event */
.next-scheduled-event-empty {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.next-scheduled-event-empty i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    opacity: 0.5;
}

.next-scheduled-event-empty p {
    margin: 0;
    font-size: 0.7rem;
}

/* --------------------------------------------
   SCHEDULE CONTAINER
   Main schedule tab layout
   -------------------------------------------- */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.schedule-section {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.schedule-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --------------------------------------------
   SCHEDULE CARDS GRID
   -------------------------------------------- */
.schedule-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 640px;
    flex: 1;
    min-height: 0;
    align-content: start;
}

.schedule-card {
    container-type: inline-size;
    container-name: schedule-card;
    background: var(--dark-bg);
    border-left: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    position: relative;
}

.schedule-card.type-match { border-left-color: var(--event-match); }
.schedule-card.type-practice { border-left-color: var(--event-practice); }
.schedule-card.type-misc { border-left-color: var(--event-misc); }

.schedule-card-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
        flex-wrap: wrap;  
}

.schedule-card-top-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

@container schedule-card (max-width: 340px) {
    .schedule-card-top-row {
        flex-wrap: wrap;
    }
    .schedule-type-badge {
        order: 1;
    }
    .schedule-card-edit-btn {
        order: 2;
    }
    .schedule-card-delete-btn {
        order: 3;
    }
}

.schedule-card-top-actions .btn-icon-action {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.schedule-card:hover .schedule-card-top-actions .btn-icon-action {
    opacity: 1;
}

.schedule-card-expand {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.schedule-card.expanded .schedule-card-expand {
    display: flex;
}

.schedule-card-chevron {
    position: absolute;
    bottom: 0.6rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--stockton-blue);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.schedule-card:hover .schedule-card-chevron,
.schedule-card.expanded .schedule-card-chevron {
    opacity: 1;
}

.schedule-card.expanded .schedule-card-chevron {
    transform: rotate(180deg);
}

.schedule-card:hover {
    border-left-color: var(--stockton-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

/* Schedule card header */
.schedule-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.schedule-card-icon {
    font-size: 1.25rem;
    color: var(--stockton-blue);
    flex-shrink: 0;
}

.schedule-card-title-section {
    flex: 1;
    min-width: 0;
}

.schedule-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

/* Schedule type badges */
.schedule-type-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.schedule-type-badge.match {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.schedule-type-badge.practice {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.schedule-type-badge.misc {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Schedule card details */
.schedule-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-card-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.schedule-card-detail i {
    width: 16px;
    font-size: 0.875rem;
    color: var(--stockton-blue);
    flex-shrink: 0;
}

.schedule-card-detail span {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.schedule-panel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.schedule-cards-column {
    flex: 6 1 320px;
    min-width: 280px;
    display: flex;
}

.schedule-cards-column .schedule-cards-grid {
    flex: 1;
}

/* --------------------------------------------
   WEEKLY ROTATING VIEW
   Shows current Sun-Sat week only 
   Swaps automatically once a new week starts
   -------------------------------------------- */
.schedule-week-panel {
    width: auto;
    max-width: 100%;
    flex: 4 1 260px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-week-top-spacer {
    flex: 0.2 1 0;
    min-height: 0;
}

.schedule-week-month-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.schedule-week-popup-row {
    flex: 0 0 340px;
    height: 340px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    gap: 0.4rem;
    overflow-y: auto;
    padding: 3px 2px 0 0;
}

.schedule-week-anchor {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-week-bottom-spacer {
    flex: 1.6 1 0;
    min-height: 0;
}

.schedule-week-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0.5rem 0 0.25rem;
}

.schedule-week-line {
    position: absolute;
    top: calc(0.5rem + 15px + 0.9rem);
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.schedule-week-day-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
    z-index: 1;
}

.schedule-week-day-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.schedule-week-day-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-week-day-circle:hover { border-color: var(--stockton-blue); color: var(--text-primary); }
.schedule-week-day-circle.today { border-color: var(--stockton-blue); color: var(--stockton-blue); }
.schedule-week-day-circle.active { background: var(--stockton-blue); border-color: var(--stockton-blue); color: black; }

.schedule-week-day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--stockton-blue);
    visibility: hidden;
}
.schedule-week-day-dot.visible { visibility: visible; }

.schedule-week-event-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    font-size: 0.6875rem;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 0.4rem;
    justify-self: stretch;
    width: 100%;
}

.schedule-week-event-card:hover { border-color: var(--stockton-blue); transform: translateY(-1px); }
.schedule-week-event-card.type-match { border-color: var(--event-match); }
.schedule-week-event-card.type-practice { border-color: var(--event-practice); }
.schedule-week-event-card.type-misc { border-color: var(--event-misc); }
.schedule-week-event-title {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-week-event-line {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}
.schedule-week-event-line i { color: var(--stockton-blue); font-size: 0.625rem; width: 10px; }

@media (max-width: 1024px) {
    .schedule-week-panel { width: 100%; }
}
@media (max-width: 768px) {
    .schedule-week-panel { display: none; }
}

/* --------------------------------------------
   SCHEDULED EVENTS LIST
   Alternative list view for schedules
   -------------------------------------------- */
.scheduled-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scheduled-event-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.scheduled-event-item:hover {
    border-color: var(--stockton-blue);
    box-shadow: 0 2px 8px rgba(121, 189, 233, 0.1);
}

.scheduled-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.scheduled-event-info h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.scheduled-event-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Scheduled event badges */
.scheduled-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.scheduled-badge.match {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.scheduled-badge.practice {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.scheduled-frequency {
    padding: 0.25rem 0.75rem;
    background: rgba(121, 189, 233, 0.1);
    color: var(--stockton-blue);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.scheduled-visibility {
    padding: 0.25rem 0.75rem;
    background: var(--dark-bg);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.scheduled-event-actions {
    display: flex;
    gap: 0.5rem;
}

.scheduled-event-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-item i {
    width: 20px;
    color: var(--stockton-blue);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.detail-item span {
    flex: 1;
}

/* --------------------------------------------
   UPCOMING EVENTS GRID
   Calendar-style upcoming event cards
   -------------------------------------------- */
.upcoming-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.upcoming-event-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.upcoming-event-card:hover {
    border-color: var(--stockton-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(121, 189, 233, 0.15);
}

.upcoming-event-date {
    background: linear-gradient(135deg, var(--stockton-blue), #1976d2);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    color: white;
}

.date-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.date-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.upcoming-event-info {
    flex: 1;
    min-width: 0;
}

.upcoming-event-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upcoming-event-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* --------------------------------------------
   SCHEDULE DETAILS MODAL
   Modal for viewing/editing schedule details
   -------------------------------------------- */
#scheduleDetailsModal .modal-content {
    max-width: 600px;
}

/* Schedule event count indicator */
.schedule-event-count {
    position: absolute;
    bottom: 0.6rem;
    left: 1rem;
    right: 1.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.schedule-card:hover .schedule-event-count {
    opacity: 1;
}

.schedule-event-count i {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    opacity: 0.8;
}

/* --------------------------------------------
   SCHEDULE EDIT FORM
   Form for editing schedule details
   -------------------------------------------- */
.schedule-edit-form {
    padding: 1rem;
}

.schedule-edit-form .form-group {
    margin-bottom: 1.25rem;
}

.schedule-edit-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.schedule-edit-form input[type="text"],
.schedule-edit-form select,
.schedule-edit-form textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.schedule-edit-form input[type="text"]:disabled,
.schedule-edit-form select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.schedule-edit-form input:focus,
.schedule-edit-form select:focus,
.schedule-edit-form textarea:focus {
    outline: none;
    border-color: var(--stockton-blue);
    box-shadow: 0 0 0 3px rgba(121, 189, 233, 0.1);
}

.schedule-edit-form textarea {
    resize: vertical;
    min-height: 80px;
}

.schedule-edit-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.schedule-edit-form .form-actions button {
    flex: 1;
}

/* --------------------------------------------
   ACTION BUTTONS
   Icon buttons for edit/delete actions
   -------------------------------------------- */

/* Base icon action button */
.btn-icon-action {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border: none;
    outline: none;
}

.btn-icon-edit {
    background: rgba(121, 189, 233, 0.1);
    color: var(--stockton-blue);
}

.btn-icon-edit:hover {
    background: var(--stockton-blue);
    color: white;
    transform: scale(1.05);
}

.btn-icon-delete {
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
}

.btn-icon-delete:hover {
    background: #ff5252;
    color: white;
    transform: scale(1.05);
}

.btn-icon-action:active {
    transform: scale(0.95);
}

/* Secondary icon button */
.btn-icon-secondary {
    background: transparent;
    border: 2px solid var(--stockton-blue);
    color: var(--stockton-blue);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    padding: 0;
}

.btn-icon-secondary:hover {
    background: var(--stockton-blue);
    color: var(--stockton-black);
    transform: scale(1.05);
}

/* Create schedule button */
.btn-create-schedule {
    background: transparent;
    border: 2px solid var(--stockton-blue);
    color: var(--stockton-blue);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-create-schedule:hover {
    background: var(--stockton-blue);
    color: var(--stockton-black);
}

/* --------------------------------------------
   EMPTY AND LOADING STATES
   Placeholder displays
   -------------------------------------------- */
.schedule-empty,
.schedule-loading,
.schedule-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    min-height: 300px;
}

.schedule-empty i,
.schedule-loading i,
.schedule-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.schedule-empty h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.schedule-empty p,
.schedule-empty-hint {
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.schedule-empty-hint {
    font-size: 0.875rem;
    font-style: italic;
}

/* --------------------------------------------
   CALENDAR STYLING
   Special styling for scheduled events in calendar
   -------------------------------------------- */
.event.scheduled-event {
    border: 2px solid white !important;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------
   RESPONSIVE DESIGN
   Mobile and tablet adaptations
   -------------------------------------------- */

@media (max-width: 1024px) {
    .schedule-cards-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 768px) {
    .schedule-card {
        padding: 0.875rem;
    }

    .schedule-card-title {
        font-size: 0.9375rem;
    }

    .schedule-cards-grid {
        grid-template-columns: 1fr;
    }
}