/**
 * File: src/assets/css/clisyc-appointment-detail.css
 * Styles for the redesigned [clisyc_appointment_detail] shortcode view.
 *
 * @package    ClientSync
 * @subpackage ClientSync/Assets/CSS
 */

/* --- 1. Main Card Container --- */
.clisyc-appointment-detail-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    max-width: 800px;
    margin: 2em auto;
    overflow: hidden; /* To contain the status badge */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- 2. Card Header --- */
.clisyc-detail-header {
    padding: 24px 32px;
    position: relative;
    border-bottom: 1px solid #f3f4f6;
}

.clisyc-detail-header h2 {
    font-size: 1.75em;
    font-weight: 700;
    color: #111827;
    margin: 0;
    padding-right: 120px; /* Space for the badge */
    line-height: 1.3;
}

/* --- 3. Status Badge (copied from cards for consistency) --- */
.clisyc-detail-status-badge {
    position: absolute;
    top: 24px;
    right: 32px;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clisyc-status-confirmed { background-color: #d1fae5; color: #065f46; }
.clisyc-status-pending { background-color: #fef3c7; color: #92400e; }
.clisyc-status-cancelled { background-color: #fee2e2; color: #991b1b; }
.clisyc-status-completed { background-color: #e0e7ff; color: #3730a3; }
.clisyc-status-waitlisted { background-color: #dbeafe; color: #1e40af; }

/* --- 4. Core Info Section (Date & Time) --- */
.clisyc-core-info {
    display: flex;
    gap: 24px;
    padding: 24px 32px;
}

.clisyc-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clisyc-info-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--clisyc-icon-bg, #1F2938);
    color: var(--clisyc-icon-text, #ffffff);
}

.clisyc-info-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.clisyc-info-text {
    font-size: 1em;
    line-height: 1.5;
}

.clisyc-info-text strong {
    display: block;
    font-weight: 600;
    color: #111827;
}

.clisyc-info-text span {
    color: #6b7280;
}

/* --- 5. Detail Sections (for Dimensions & Custom Fields) --- */
.clisyc-detail-section {
    padding: 24px 32px;
    border-top: 1px solid #f3f4f6;
}

.clisyc-detail-section h3 {
    font-size: 1.25em;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px;
}

.clisyc-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.clisyc-details-list li {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f9fafb;
}
.clisyc-details-list li:last-child {
    border-bottom: none;
}

/* Dimension icons from the Dimension Manager */
.clisyc-dim-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--clisyc-icon-bg, #1F2938);
    color: var(--clisyc-icon-text, #ffffff);
    font-size: 14px;
    margin-right: 10px;
}

.clisyc-dim-icon .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.clisyc-details-list .label {
    font-weight: 500;
    color: #6b7280;
}

.clisyc-details-list .value {
    margin-left: auto;
    font-weight: 600;
    color: #1f2937;
    text-align: right;
}

/* Image Map Display */
.clisyc-image-marker-display-wrapper {
    position: relative;
    max-width: 100%;
    border: 1px solid #ddd;
    line-height: 0;
    margin-top: 10px;
}
.clisyc-image-marker-display-wrapper > img { max-width: 100%; height: auto; }
.clisyc-image-marker-display-wrapper > .clisyc-marker-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* --- 6. Venue Location Section --- */
.clisyc-venue-location__photo {
    margin-bottom: 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.clisyc-venue-location__photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
}

.clisyc-venue-location__name {
    font-size: 1.15em;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.clisyc-venue-location__address {
    font-style: normal;
    color: #4b5563;
    line-height: 1.6;
    white-space: pre-line;
    margin-bottom: 12px;
}

.clisyc-venue-location__map {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.clisyc-venue-location__map iframe {
    display: block;
    width: 100%;
}

/* --- 7. Seat Details Section --- */
.clisyc-seat-details__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.clisyc-seat-details__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.15s ease;
}

.clisyc-seat-details__card:hover {
    border-color: #cbd5e1;
}

.clisyc-seat-details__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--clisyc-icon-bg, #1F2938);
    color: var(--clisyc-icon-text, #ffffff);
}

.clisyc-seat-details__icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.clisyc-seat-details__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.clisyc-seat-details__section {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.clisyc-seat-details__row-seat {
    font-size: 13px;
    color: #64748b;
}

.clisyc-seat-details__category {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
    width: fit-content;
    margin-top: 2px;
}

/* --- 8. Venue Map Section --- */
.clisyc-venue-map__container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    overflow: hidden;
}

.clisyc-venue-map__container svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
}

.clisyc-venue-map__legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 12px 0 0;
    font-size: 13px;
    color: #64748b;
}

.clisyc-venue-map__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.clisyc-venue-map__legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.clisyc-venue-map__legend-item--selected .clisyc-venue-map__legend-swatch {
    background: #3b82f6;
    border: 1.5px solid #1d4ed8;
}

.clisyc-venue-map__legend-item--other .clisyc-venue-map__legend-swatch {
    background: #e5e7eb;
    border: 1.5px solid #9ca3af;
}

/* --- 9. QR Ticket Section --- */
.clisyc-qr-ticket__wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
}

.clisyc-qr-ticket__code {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

.clisyc-qr-ticket__code svg {
    width: 100%;
    height: 100%;
}

.clisyc-qr-ticket__hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: #64748b;
    text-align: center;
}

/* --- 10. Action Buttons --- */
.clisyc-detail-actions {
    padding: 24px 32px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.clisyc-detail-actions .button {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    min-height: 44px;
    transition: all 0.2s;
}

.clisyc-detail-actions .clisyc-button-ical {
    background: #374151;
    border-color: #374151;
    color: #ffffff;
}
.clisyc-detail-actions .clisyc-button-ical:hover {
    background: #1f2937;
    border-color: #1f2937;
}

.clisyc-detail-actions .clisyc-button-cancel {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
}
.clisyc-detail-actions .clisyc-button-cancel:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* --- 11. Responsive --- */
@media (max-width: 768px) {
    .clisyc-appointment-detail-card {
        margin: 1em 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .clisyc-detail-header,
    .clisyc-core-info,
    .clisyc-detail-section,
    .clisyc-detail-actions {
        padding: 20px;
    }

    .clisyc-detail-header h2 {
        font-size: 1.5em;
    }

    .clisyc-core-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .clisyc-detail-actions .button {
        width: 100%;
    }

    .clisyc-seat-details__grid {
        grid-template-columns: 1fr;
    }

    .clisyc-venue-map__container {
        padding: 10px;
    }

    .clisyc-venue-map__container svg {
        max-height: 350px;
    }

    .clisyc-qr-ticket__code {
        width: 180px;
        height: 180px;
    }
}