/**
 * Fleet Terminplan Frontend Styles
 * Design passend zu fleet-data.de
 */

:root {
    --primary-blue: #5A6E7F;
    --dark-blue: #4A5A68;
    --light-blue: #6B8499;
    --accent-blue: #7A94AC;
    --text-dark: #2F3E51;
    --text-white: #ffffff;
    --bg-light: #f8f9fa;
}

.fleet-terminplan-frontend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Filters */
.fleet-terminplan-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(90, 110, 127, 0.1);
    border-radius: 8px;
}

.fleet-terminplan-filters label {
    margin-right: 10px;
    font-weight: 600;
    color: var(--primary-blue);
}

.fleet-terminplan-filters select {
    padding: 8px 12px;
    border: 2px solid rgba(90, 110, 127, 0.3);
    border-radius: 6px;
    background: white;
    color: var(--text-dark);
    font-size: 14px;
}

/* Calendar Container */
#fleet-terminplan-calendar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* FullCalendar Customization */
.fc {
    font-family: inherit;
}

.fc .fc-button-primary {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    color: white !important;
}

.fc .fc-button-primary:hover {
    background-color: var(--dark-blue) !important;
    border-color: var(--dark-blue) !important;
}

.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--dark-blue) !important;
    border-color: var(--dark-blue) !important;
}

.fc .fc-event {
    border-radius: 6px;
    padding: 4px 8px;
    font-weight: 500;
}

.fc .fc-daygrid-day-number {
    color: var(--text-dark);
    font-weight: 600;
}

.fc .fc-col-header-cell {
    background-color: rgba(90, 110, 127, 0.1);
    font-weight: 600;
    color: var(--primary-blue);
}

.fc .fc-timegrid-slot {
    height: 3em;
}

.fc .fc-highlight {
    background-color: rgba(90, 110, 127, 0.2) !important;
}

/* ============================================================
   FIX: Hover nur auf einzelner Zelle / einzelnem Termin
   (statt dass der ganze Kalender weiss wird)
   ============================================================ */

/* Nur die ueberfahrene Tages-Zelle bzw. Spalte dezent hervorheben */
.fc .fc-daygrid-day:hover,
.fc .fc-timegrid-col:hover {
    background-color: rgba(90, 110, 127, 0.06);
    transition: background-color .12s ease;
}

/* Termine behalten beim Hover IHRE Farbe (werden NICHT weiss) und
   bekommen nur eine dezente Hervorhebung der einzelnen Zelle */
.fc .fc-event {
    transition: filter .12s ease, box-shadow .12s ease;
}

.fc .fc-event:hover {
    opacity: 1 !important;
    filter: brightness(0.94);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

/* Event-Text bleibt lesbar – verhindert weissen/unsichtbaren Text
   durch ueberlagernde Theme-Link-Hover-Regeln (a:hover {color:#fff}) */
.fc .fc-event,
.fc .fc-event:hover,
.fc .fc-event .fc-event-title,
.fc .fc-event .fc-event-time,
.fc .fc-event .fc-event-main {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Modal */
.fleet-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fleet-modal-content {
    background-color: #2C3E50;
    margin: auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

.fleet-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.fleet-modal-close:hover {
    color: var(--primary-blue);
}

.fleet-modal h2 {
    color: #178687;
    margin: 0 0 20px 0;
    font-size: 24px;
}

/* ============================================================
   FIX: Termin-Detail-Dialog (Klick auf einen Termin)
   ============================================================ */
.appointment-details {
    margin-bottom: 10px;
}

.appointment-details .detail-row {
    display: flex;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(90, 110, 127, 0.12);
    font-size: 14px;
}

.appointment-details .detail-row:last-child {
    border-bottom: none;
}

.appointment-details .detail-label {
    flex: 0 0 130px;
    font-weight: 600;
    color: var(--primary-blue);
}

.appointment-details .detail-value {
    flex: 1;
    color: var(--text-dark);
    word-break: break-word;
    white-space: pre-line;
}

.appointment-details .detail-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.detail-status.status-pending   { background: #b8860b; }
.detail-status.status-confirmed { background: #2e7d32; }
.detail-status.status-cancelled { background: #c62828; }
.detail-status.status-completed { background: var(--primary-blue); }

/* Booking Form */
.booking-datetime {
    background: rgba(90, 110, 127, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 16px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 25, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-row input::placeholder,
.form-row select::placeholder,
.form-row textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-row select option {
    background: #2C3E50;
    color: #ffffff;
}
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-row input::placeholder,
.form-row select::placeholder,
.form-row textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-row select option {
    background: #2C3E50;
    color: #ffffff;
}
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-row input::placeholder,
.form-row select::placeholder,
.form-row textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-row select option {
    background: #2C3E50;
    color: #ffffff;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #178687;
}

.form-row textarea {
    resize: vertical;
    font-family: inherit;
}

/* Available Slots */
.slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
}

.slot-button {
    padding: 12px;
    background: white;
    border: 2px solid rgba(90, 110, 127, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.slot-button:hover {
    background: rgba(90, 110, 127, 0.1);
    border-color: #178687;
    transform: translateY(-2px);
}

.slot-button.selected {
    background: var(--primary-blue);
    color: white;
    border-color: #178687;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(90, 110, 127, 0.1);
}

.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.button-primary {
    background: var(--primary-blue);
    color: white;
}

.button-primary:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 110, 127, 0.3);
}

.button-secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.button-secondary:hover {
    background: rgba(90, 110, 127, 0.1);
}

.booking-notice {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .fleet-terminplan-frontend {
        padding: 10px;
    }

    .fleet-modal-content {
        padding: 20px;
        width: 95%;
    }

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

    .form-actions {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .appointment-details .detail-row {
        flex-direction: column;
        gap: 2px;
    }
    .appointment-details .detail-label {
        flex: none;
    }
}

/* Loading State */
.fc .fc-loading {
    color: var(--primary-blue);
}

/* Success/Error Messages */
.fleet-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.fleet-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fleet-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ================================================
   ERZWUNGENE STYLES - ÜBERSCHREIBT ALLES
   ================================================ */

.fleet-modal-content {
    background-color: #2C3E50 !important;
    border: 2px solid rgba(23, 134, 135, 0.3) !important;
}

.fleet-modal h2 {
    color: #178687 !important;
}

.fleet-terminplan-frontend .form-row label {
    color: rgba(255, 255, 255, 0.9) !important;
}

.fleet-terminplan-frontend .form-row input[type="text"],
.fleet-terminplan-frontend .form-row input[type="email"],
.fleet-terminplan-frontend .form-row input[type="tel"],
.fleet-terminplan-frontend .form-row select,
.fleet-terminplan-frontend .form-row textarea {
    background: rgba(15, 25, 35, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    padding: 14px 16px !important;
}

.fleet-terminplan-frontend .form-row input::placeholder,
.fleet-terminplan-frontend .form-row select::placeholder,
.fleet-terminplan-frontend .form-row textarea::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.fleet-terminplan-frontend .form-row select option {
    background: #2C3E50 !important;
    color: #ffffff !important;
}

.fleet-terminplan-frontend .form-row input:focus,
.fleet-terminplan-frontend .form-row select:focus,
.fleet-terminplan-frontend .form-row textarea:focus {
    border-color: #178687 !important;
}

.fleet-terminplan-frontend .button-primary {
    background: #178687 !important;
    color: #1a2535 !important;
}
