/**
 * Terminbuchung Frontend Styles
 *
 * @package Terminbuchung
 */

/* =========================================================
   Container
   ========================================================= */

.terminbuchung-wrap {
    max-width: 600px;
    margin: 2em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.terminbuchung-header {
    margin-bottom: 1.5em;
}

.terminbuchung-header h2 {
    margin: 0 0 0.3em 0;
    font-size: 1.5em;
    color: #1a1a1a;
}

.terminbuchung-subtitle {
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

/* =========================================================
   Lade-Indikator
   ========================================================= */

.terminbuchung-loading {
    text-align: center;
    padding: 2em;
    color: #666;
}

.terminbuchung-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: terminbuchung-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes terminbuchung-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================================
   Fehler
   ========================================================= */

.terminbuchung-error {
    background: #fef0f0;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1em 1.2em;
    border-radius: 4px;
    margin-bottom: 1em;
}

.terminbuchung-error-message {
    margin: 0 0 0.5em 0;
    font-weight: 600;
}

.terminbuchung-error-hint {
    margin: 0;
    font-size: 0.9em;
    color: #856404;
}

/* =========================================================
   Wochen-Navigation
   ========================================================= */

.terminbuchung-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1em;
    padding: 0.5em 0;
    border-bottom: 1px solid #e0e0e0;
}

.terminbuchung-nav-btn {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 0.4em 1em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    transition: background 0.2s, color 0.2s;
}

.terminbuchung-nav-btn:hover:not(:disabled) {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.terminbuchung-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.terminbuchung-week-label {
    font-weight: 600;
    font-size: 1em;
    color: #333;
}

/* =========================================================
   Slot-Raster
   ========================================================= */

.terminbuchung-date-group {
    margin-bottom: 1.5em;
}

.terminbuchung-date-heading {
    font-weight: 600;
    font-size: 1em;
    color: #1a1a1a;
    margin-bottom: 0.5em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eee;
}

.terminbuchung-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.terminbuchung-slot-btn {
    display: block;
    width: 100%;
    padding: 0.6em 0.5em;
    background: #f0f7fc;
    border: 1px solid #c3d9e9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    text-align: center;
    color: #0073aa;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.terminbuchung-slot-btn:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.terminbuchung-slot-btn.selected {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    font-weight: 600;
}

.terminbuchung-no-slots {
    text-align: center;
    padding: 2em;
    color: #999;
    font-style: italic;
}

/* =========================================================
   Buchungsformular
   ========================================================= */

.terminbuchung-form-section {
    margin-top: 1.5em;
    padding: 1.5em;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.terminbuchung-form-section h3 {
    margin: 0 0 1em 0;
    font-size: 1.1em;
    color: #1a1a1a;
}

.terminbuchung-selected-slot {
    background: #e8f4f8;
    border: 1px solid #c3d9e9;
    padding: 0.8em 1em;
    border-radius: 4px;
    margin-bottom: 1.2em;
    font-size: 0.95em;
    color: #005a87;
}

.terminbuchung-field {
    margin-bottom: 1em;
}

.terminbuchung-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3em;
    font-size: 0.9em;
    color: #444;
}

.terminbuchung-input {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.terminbuchung-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.terminbuchung-input.error {
    border-color: #dc3232;
    background: #fef0f0;
}

.terminbuchung-submit {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 0.7em 1.5em;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.terminbuchung-submit:hover {
    background: #005a87;
}

.terminbuchung-submit:disabled {
    background: #999;
    cursor: not-allowed;
}

.terminbuchung-cancel {
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
    padding: 0.7em 1.5em;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    margin-left: 0.5em;
    transition: background 0.2s;
}

.terminbuchung-cancel:hover {
    background: #f0f0f0;
}

.terminbuchung-form-message {
    margin-top: 1em;
    padding: 0.8em 1em;
    border-radius: 4px;
    font-size: 0.95em;
}

.terminbuchung-form-message.error {
    background: #fef0f0;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.terminbuchung-form-message.success {
    background: #f0f8f0;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* =========================================================
   Erfolgsanzeige
   ========================================================= */

.terminbuchung-success {
    text-align: center;
    padding: 2em;
    background: #f0f8f0;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
}

.terminbuchung-success-icon {
    font-size: 3em;
    color: #46b450;
    margin-bottom: 0.3em;
}

.terminbuchung-success h3 {
    margin: 0 0 0.5em 0;
    font-size: 1.3em;
    color: #155724;
}

.terminbuchung-success p {
    margin: 0 0 1em 0;
}

.terminbuchung-new-booking {
    background: #46b450;
    color: #fff;
    border: none;
    padding: 0.6em 1.5em;
    border-radius: 4px;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.terminbuchung-new-booking:hover {
    background: #3a9e43;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 480px) {
    .terminbuchung-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .terminbuchung-week-nav {
        flex-wrap: wrap;
        gap: 0.5em;
    }

    .terminbuchung-week-label {
        order: -1;
        width: 100%;
        text-align: center;
    }
}