/**
 * CSS Clean - Sans cadres imbriqués + Échéancier collapsible
 * Optimisé pour fond sombre
 */

/* Reset */
.custom-order-summary {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
    line-height: 1.5;
}

.custom-order-summary *,
.order-summary-clean * {
    box-sizing: border-box;
}

/* Conteneur principal - SANS bordure */
.order-summary-clean {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #ffffff;
}

/* Section Programme */
.programme-section {
    margin-bottom: 32px;
}

.programme-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.programme-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.programme-content:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
}

.programme-name {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.4;
}

.programme-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.detail-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-size: 14px;
}

.detail-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.detail-value.price {
    color: #4CAF50;
    font-size: 16px;
    font-weight: 700;
}

.detail-value.paid {
    color: #4CAF50;
    font-weight: 700;
}

/* Échéancier collapsible */
.schedule-section {
    margin-top: 24px;
}

.schedule-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 24px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    outline: none;
}

.schedule-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.schedule-toggle:focus {
    outline: none;
}

.schedule-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: rgba(255, 255, 255, 0.07);
    border-bottom-color: transparent;
}

.schedule-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-arrow {
    font-size: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.7);
}

.schedule-toggle.active .schedule-arrow {
    transform: rotate(180deg);
}

.schedule-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 0 24px 24px 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    overflow: hidden;
}

.schedule-content.active {
    display: block;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 600px;
        padding-bottom: 24px;
    }
}

/* Table responsive moderne */
.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

.schedule-table col.col-echeance { width: 20%; }
.schedule-table col.col-date { width: 30%; }
.schedule-table col.col-montant { width: 25%; }
.schedule-table col.col-statut { width: 25%; }

.schedule-table th {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 8px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.schedule-table th:first-child {
    border-top-left-radius: 8px;
}

.schedule-table th:last-child {
    border-top-right-radius: 8px;
}

.schedule-table td {
    padding: 10px 8px;
    color: #ffffff;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-table tbody tr:last-child td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.schedule-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.schedule-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

/* Status styles sans icônes, centrés */
.status-paid {
    color: #4CAF50;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
}

.status-upcoming {
    color: #FF9800;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
}

.schedule-table th:last-child,
.schedule-table td:last-child {
    text-align: center;
}

.status-upcoming::before {
    content: "⏳";
    font-size: 12px;
}

.total-summary {
    margin-top: 16px;
    padding: 16px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    text-align: center;
}

.total-amount {
    font-size: 18px;
    font-weight: 700;
    color: #4CAF50;
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.programme-content {
    animation: fadeIn 0.4s ease-out;
}

/* Responsive Mobile */
@media (max-width: 768px) {

    .programme-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .programme-content {
        padding: 20px 16px;
        border-radius: 10px;
    }

    .programme-name {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .programme-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .detail-item {
        padding: 12px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        text-align: left;
    }

    .detail-label {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.6);
    }

    .detail-value {
        align-self: flex-end;
        font-size: 15px;
    }

    .detail-value.price {
        font-size: 17px;
    }

    .schedule-toggle {
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 10px;
    }

    .schedule-toggle.active {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .schedule-content {
        padding: 0 20px 20px 20px;
        border-radius: 0 0 10px 10px;
    }

    /* Cards pour mobile - Layout amélioré */
    .schedule-table,
    .schedule-table thead,
    .schedule-table tbody,
    .schedule-table th,
    .schedule-table td,
    .schedule-table tr {
        display: block;
    }

    .schedule-table thead {
        display: none;
    }

    .schedule-table {
        border: none;
        background: transparent;
        margin-top: 12px;
        border-radius: 0;
    }

    .schedule-table tr {
        margin-bottom: 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.03);
        padding: 16px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 12px 16px;
        transition: all 0.2s ease;
    }

    .schedule-table tr:hover {
        background: rgba(255, 255, 255, 0.06);
        transform: translateY(-1px);
    }

    .schedule-table td {
        border: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: transparent;
        font-size: 14px;
    }

    .schedule-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: rgba(255, 255, 255, 0.5);
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }

    .schedule-table td:nth-child(4) {
        grid-column: 1 / -1;
        text-align: center;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: center;
        align-items: center;
        display: flex;
        flex-direction: row;
        gap: 8px;
    }

    .schedule-table td:nth-child(4)::before {
        margin-bottom: 0;
        font-size: 11px;
    }

    .total-summary {
        text-align: center;
        padding: 14px;
        margin-top: 12px;
    }

    .total-amount {
        font-size: 16px;
    }
}

/* Responsive Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .programme-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .schedule-table {
        font-size: 13px;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 12px 14px;
    }

    .schedule-toggle {
        padding: 18px 22px;
    }

    .schedule-content {
        padding: 0 22px 22px 22px;
    }
}

/* Desktop large */
@media (min-width: 1200px) {
    .order-summary-clean {
        max-width: 1200px;
    }

    .programme-content {
        padding: 28px 32px;
    }

    .programme-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .programme-details {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .detail-item {
        padding: 14px 18px;
    }

    .schedule-toggle {
        padding: 24px 32px;
        font-size: 19px;
    }

    .schedule-content {
        padding: 0 32px 32px 32px;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 16px 18px;
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    .programme-content,
    .schedule-content,
    .detail-item,
    .schedule-table tr {
        animation: none;
        transition: none;
    }

    .schedule-arrow {
        transition: none;
    }

    .programme-content:hover,
    .schedule-toggle:hover {
        transform: none;
    }
}

/* Focus states simplifiés */
.detail-item:focus-within,
.schedule-table tr:focus-within {
    outline: none;
}

/* Contrast élevé */
@media (prefers-contrast: high) {
    .programme-content,
    .schedule-toggle,
    .schedule-content {
        border: 2px solid rgba(255, 255, 255, 0.3);
        background: rgba(0, 0, 0, 0.8);
    }

    .detail-item {
        border: 1px solid rgba(255, 255, 255, 0.4);
        background: rgba(0, 0, 0, 0.6);
    }

    .schedule-table th {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .schedule-table td {
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* States actifs */
.schedule-toggle:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.1);
}

/* Scrollbar personnalisée pour le contenu */
.schedule-content::-webkit-scrollbar {
    width: 6px;
}

.schedule-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.schedule-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.schedule-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.programme-content {
    margin-top: 20px !important;
}

