/* ============================================
   SUE Trainingskalender Widget — Styles
   Prefixed with tw- to avoid conflicts
   ============================================ */

/* Grid layout */
.tw-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   Maand Headers
   ============================================ */
.tw-maand-header {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--dark-gray, #797979);
    padding: 1.25rem 0 0.75rem;
    margin-top: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tw-maand-header:first-child {
    margin-top: 0;
}

/* ============================================
   Detail Card (uitgebreide trainingskaart)
   ============================================ */
.tw-card {
    background: var(--white, #FFFFFF);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--card-radius, 12px);
    padding: 28px 32px;
    transition: all 0.3s ease;
}

.tw-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.tw-card--vol {
    opacity: 0.6;
    background: var(--light-gray, #F2F2F2);
}

.tw-card--vol:hover {
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.08);
}

.tw-card-main {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.tw-card-info {
    flex: 1;
    min-width: 0;
}

.tw-card-header {
    margin-bottom: 12px;
}

.tw-card-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--black, #1a1a1a);
    line-height: 1.3;
    margin: 0 0 6px;
}

.tw-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--dark-gray, #797979);
    align-items: center;
}

.tw-card-date {
    font-weight: 600;
    color: var(--black, #1a1a1a);
}

.tw-card-sep {
    color: var(--dark-gray, #797979);
    opacity: 0.4;
}

.tw-card-price {
    font-weight: 600;
    color: var(--black, #1a1a1a);
}

.tw-card-adres {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--dark-gray, #797979);
    margin-top: 2px;
}

.tw-card-description {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--dark-gray, #797979);
    margin: 0 0 12px;
}

/* ============================================
   Expandable Highlights
   ============================================ */
.tw-card-expandable[data-expanded="false"] .tw-card-highlights {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.tw-card-expandable[data-expanded="true"] .tw-card-highlights {
    max-height: 500px;
    opacity: 1;
}

.tw-card-highlights {
    transition: max-height 0.35s ease, opacity 0.25s ease;
    margin-top: 8px;
}

.tw-card-highlights ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tw-card-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--black, #1a1a1a);
    line-height: 1.5;
}

.tw-check {
    flex-shrink: 0;
    margin-top: 2px;
}

.tw-card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 4px 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--coral, #FF5A5F);
    cursor: pointer;
    transition: color 0.2s;
}

.tw-card-toggle:hover {
    color: #e54e53;
}

.tw-card-toggle-icon {
    transition: transform 0.3s ease;
}

.tw-card-expandable[data-expanded="true"] .tw-card-toggle-icon {
    transform: rotate(180deg);
}

/* ============================================
   Card Actions (rechterkolom)
   ============================================ */
.tw-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
    min-width: 180px;
}

.tw-card-link {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--coral, #FF5A5F);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.tw-card-link:hover {
    border-bottom-color: var(--coral, #FF5A5F);
}

/* ============================================
   Status Badges
   ============================================ */
.tw-status {
    display: inline-flex;
    align-items: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 5px 14px;
    border-radius: 25px;
    white-space: nowrap;
}

.tw-status--available {
    background: var(--green-light, #E8F5E9);
    color: var(--green, #2E7D32);
}

.tw-status--urgent {
    background: var(--coral, #FF5A5F);
    color: white;
}

.tw-status--full {
    background: var(--light-gray, #F2F2F2);
    color: var(--dark-gray, #797979);
}

/* ============================================
   Buttons
   ============================================ */
.tw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.tw-btn--primary {
    background: var(--coral, #FF5A5F);
    color: white;
}

.tw-btn--primary:hover {
    background: #e54e53;
    box-shadow: 0 4px 12px rgba(255, 90, 95, 0.3);
    transform: translateY(-1px);
}

.tw-btn--disabled {
    background: var(--light-gray, #F2F2F2);
    color: var(--dark-gray, #797979);
    cursor: not-allowed;
    pointer-events: none;
}

.tw-btn--submit {
    width: 100%;
    background: var(--coral, #FF5A5F);
    color: white;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 8px;
}

.tw-btn--submit:hover {
    background: #e54e53;
    box-shadow: 0 4px 16px rgba(255, 90, 95, 0.3);
}

.tw-btn--submit:disabled {
    background: var(--dark-gray, #797979);
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   Compact Variant
   ============================================ */
.tw-compact-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tw-compact-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--light-gray, #F2F2F2);
    text-decoration: none;
    transition: all 0.2s ease;
}

.tw-compact-row:hover {
    background: var(--coral-lighter, #FFE5E5);
}

.tw-compact-row--vol {
    opacity: 0.5;
    pointer-events: none;
}

.tw-compact-date {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--black, #1a1a1a);
    min-width: 140px;
}

.tw-compact-title {
    font-family: Georgia, serif;
    font-size: 0.9rem;
    color: var(--dark-gray, #797979);
    flex: 1;
}

/* Compact row inschrijven link */
.tw-compact-inschrijven {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--coral, #FF5A5F);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 10px;
    border: 1.5px solid var(--coral, #FF5A5F);
    border-radius: 4px;
    margin-left: 8px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.tw-compact-inschrijven:hover {
    background: var(--coral, #FF5A5F);
    color: #fff;
}

/* ============================================
   Loading & Empty
   ============================================ */
.tw-loading,
.tw-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--dark-gray, #797979);
    font-family: Georgia, serif;
    font-size: 0.95rem;
}

.tw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--light-gray, #F2F2F2);
    border-top-color: var(--coral, #FF5A5F);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: tw-spin 0.8s linear infinite;
}

@keyframes tw-spin {
    to { transform: rotate(360deg); }
}

/* "Alle trainingen" link */
.tw-meer {
    text-align: center;
    margin-top: 24px;
}

.tw-meer-link {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--coral, #FF5A5F);
    text-decoration: none;
    border-bottom: 1px solid var(--coral, #FF5A5F);
    padding-bottom: 2px;
    transition: opacity 0.2s;
}

.tw-meer-link:hover {
    opacity: 0.7;
}

/* ============================================
   INSCHRIJF-MODAL
   ============================================ */
.tw-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.tw-modal--open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tw-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: tw-fadeIn 0.2s ease;
}

.tw-modal-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    margin: 20px;
    animation: tw-slideUp 0.3s ease;
}

.tw-modal-card {
    background: var(--white, #FFFFFF);
    border-radius: 16px;
    overflow-y: auto;
    max-height: 90vh;
    padding: 36px;
}

.tw-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-gray, #797979);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
    z-index: 2;
}

.tw-modal-close:hover {
    color: var(--black, #1a1a1a);
}

.tw-modal-header {
    margin-bottom: 28px;
    padding-right: 32px;
}

.tw-modal-title {
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--black, #1a1a1a);
    line-height: 1.3;
    margin: 0 0 6px;
}

.tw-modal-meta {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--dark-gray, #797979);
    margin: 0;
}

/* ============================================
   Form Styles
   ============================================ */
.tw-form-section {
    margin-bottom: 24px;
}

.tw-form-section-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dark-gray, #797979);
    margin: 0 0 16px;
}

.tw-form-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--dark-gray, #797979);
    opacity: 0.7;
}

.tw-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.tw-form-row:last-child {
    margin-bottom: 0;
}

.tw-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tw-form-field--small {
    max-width: 160px;
}

.tw-form-field label {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--black, #1a1a1a);
}

.tw-form-field input,
.tw-form-field select {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    padding: 10px 14px;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    color: var(--black, #1a1a1a);
    background: var(--white, #FFFFFF);
    transition: border-color 0.2s;
    outline: none;
}

.tw-form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23797979' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.tw-form-field input:focus,
.tw-form-field select:focus {
    border-color: var(--coral, #FF5A5F);
    box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.1);
}

.tw-form-field input::placeholder {
    color: var(--dark-gray, #797979);
    opacity: 0.5;
}

.tw-form-hint {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--dark-gray, #797979);
    line-height: 1.4;
    margin-top: 2px;
}

/* Extra deelnemers */
.tw-form-extra-header {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--coral, #FF5A5F);
    margin: 24px 0 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.tw-form-extra-deelnemer {
    background: var(--light-gray, #F2F2F2);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    animation: tw-slideUp 0.25s ease;
}

.tw-form-extra-label {
    display: block;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--coral, #FF5A5F);
    margin-bottom: 12px;
}

.tw-form-extra-deelnemer .tw-form-row {
    margin-bottom: 12px;
}

.tw-form-extra-deelnemer .tw-form-field {
    margin-bottom: 8px;
}

.tw-form-extra-deelnemer input {
    background: var(--white, #FFFFFF);
}

/* Checkboxes */
.tw-form-agreements {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tw-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--dark-gray, #797979);
    line-height: 1.5;
}

.tw-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--coral, #FF5A5F);
    cursor: pointer;
}

.tw-checkbox a {
    color: var(--coral, #FF5A5F);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.tw-checkbox a:hover {
    border-bottom-color: var(--coral, #FF5A5F);
}

/* Error message */
.tw-form-error {
    background: #FFF3F3;
    border: 1px solid var(--coral, #FF5A5F);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--coral, #FF5A5F);
    margin-bottom: 16px;
}

/* ============================================
   Confirmation
   ============================================ */
.tw-modal-confirmation {
    text-align: center;
    padding: 20px 0;
}

.tw-confirmation-icon {
    margin-bottom: 20px;
}

.tw-modal-confirmation h3 {
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--black, #1a1a1a);
    margin: 0 0 12px;
}

.tw-confirmation-text {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    color: var(--dark-gray, #797979);
    line-height: 1.6;
    margin: 0 0 8px;
}

.tw-confirmation-detail {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black, #1a1a1a);
    margin: 0 0 24px;
}

.tw-btn--close-modal {
    margin-top: 8px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes tw-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tw-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .tw-card-main {
        flex-direction: column;
        gap: 16px;
    }

    .tw-card-actions {
        flex-direction: row;
        align-items: center;
        min-width: auto;
        width: 100%;
        justify-content: space-between;
    }

    .tw-card-link {
        order: -1;
    }
}

@media (max-width: 600px) {
    .tw-card {
        padding: 20px;
    }

    .tw-card-meta {
        font-size: 0.78rem;
    }

    .tw-card-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tw-compact-row {
        flex-wrap: wrap;
    }

    .tw-compact-date {
        min-width: auto;
        width: 100%;
    }

    /* Modal responsive */
    .tw-modal-container {
        margin: 10px;
        max-height: 95vh;
    }

    .tw-modal-card {
        padding: 24px;
        border-radius: 12px;
        max-height: 95vh;
    }

    .tw-form-row {
        grid-template-columns: 1fr;
    }

    .tw-modal-title {
        font-size: 1.15rem;
    }
}
