/* wwwroot/css/styles.css */

/* --- RESET & TIPOGRAFÍA BÁSICA --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.card-container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* --- HEADER DE LA ORDEN --- */
/* --- CABECERA MODERNA v2 --- */
.order-header-v2 {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
}

    .order-header-v2:hover {
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    }

/* --- Top Bar --- */
.order-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-title h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #111827;
    font-weight: 700;
}

.header-title .subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* --- Botón --- */
.btn-back {
    background: #2563eb;
    border: none;
    color: white;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s;
}

    .btn-back:hover {
        background: #1e40af;
    }

/* --- Tarjetas de información --- */
.order-info-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .info-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .info-card i {
        font-size: 1.5rem;
        color: #2563eb;
        background: rgba(37, 99, 235, 0.08);
        padding: 10px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .info-card .label {
        margin: 0;
        color: #6b7280;
        font-size: 0.8rem;
        letter-spacing: 0.3px;
    }

    .info-card .value {
        margin: 2px 0 0 0;
        color: #111827;
        font-weight: 600;
        font-size: 1rem;
        word-break: break-word;
    }

@media (max-width: 768px) {
    .order-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-back {
        width: 100%;
        justify-content: center;
    }
}



/* --- CONTENEDOR DE LA LÍNEA DE TIEMPO --- */
.timeline-container {
    padding: 30px 20px 20px 40px; /* Padding izquierdo para la línea */
    position: relative;
}

    .timeline-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 45px; /* Posición de la línea */
        width: 2px;
        height: 100%;
        background-color: #e0e0e0;
    }

/* --- ITEM DE LA LÍNEA DE TIEMPO --- */
.timeline-item {
    margin-bottom: 5px;
    position: relative;
    opacity: 0.5; /* Opacidad por defecto para pasos no completados */
}

    .timeline-item.complete {
        opacity: 1; /* Paso completado */
    }

    .timeline-item.highlight {
        opacity: 1;
        font-weight: bold;
    }

/* Icono del Círculo (el punto en la línea) */
.icon-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid #17a2b8;
    color: #17a2b8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: -32px; /* Alinea el círculo con la línea */
    top: 0;
    z-index: 10;
    font-size: 0.9em;
}

.timeline-item.complete .icon-circle {
    background-color: #28a745; /* Verde para completado */
    border-color: #28a745;
    color: white;
}

/* Contenido del Header (la parte cliqueable del acordeón) */
.item-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 10px 10px 0;
    transition: background-color 0.3s;
}

    .item-header:hover {
        background-color: #f0f0f0;
        border-radius: 5px;
    }

.item-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex-grow: 1;
    margin-left: 20px;
}

.item-number {
    position: absolute;
    left: -48px;
    font-weight: bold;
    font-size: 0.8em;
    color: #999;
    top: 8px;
}

.title-date {
    display: block;
    margin-bottom: 5px;
}

    .title-date .title {
        font-weight: bold;
        color: #333;
    }

    .title-date .date {
        font-size: 0.8em;
        color: #6c757d;
        margin-left: 10px;
    }

.item-content p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

/* Ícono de Chevron */
.toggle-icon {
    transition: transform 0.3s ease;
    color: #6c757d;
    font-size: 0.8em;
}

    .toggle-icon.rotated {
        transform: rotate(180deg);
    }

/* --- CONTENIDO DETALLADO DEL ACORDEÓN (La animación) --- */
.item-details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out; /* Clave de la animación */
    padding-left: 25px;
}

.details-section {
    padding: 5px 0 5px 0;
    border-left: 1px dashed #ccc;
    margin-left: -50px;
    padding-left: 50px;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

    .details-header h3 {
        font-size: 1.2em;
        color: #333;
        margin: 0;
    }

.download-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
}

.comments-section, .photos-section {
    margin-top: 15px;
    padding: 5px;
    background-color: #f8f9fa;
    border-left: 3px solid #17a2b8;
    border-radius: 4px;
}

    .comments-section p {
        white-space: pre-wrap;
    }

.photos-section {
    border-left: 3px solid #ffc107;
}

.photo-gallery {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

    .photo-gallery img {
        width: 200px;
        height: auto;
        object-fit: cover;
        border-radius: 4px;
        border: 1px solid #ddd;
    }

/* --- ESTILOS DE BOTÓN DE FIRMA --- */
.sign-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
    transition: background-color 0.3s;
}

    .sign-button:hover {
        background-color: #0056b3;
    }


/* --- MODAL DE FIRMA --- */
.modal {
    position: fixed; /* Se mantiene fijo en la ventana */
    z-index: 1000; /* Asegura que esté por encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* Fondo oscuro */
    /* El display: none/block es controlado por Blazor C# */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

    .close-button:hover,
    .close-button:focus {
        color: #000;
        text-decoration: none;
        cursor: pointer;
    }

#signatureCanvas {
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    touch-action: none; /* Importante para dispositivos táctiles */
    width: 100%;
    height: 200px;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

    .modal-buttons button {
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 1em;
        border: none;
    }

    .modal-buttons .confirm-button {
        background-color: #28a745;
        color: white;
    }

    .modal-buttons .clear-button {
        background-color: #6c757d;
        color: white;
    }











/* --- Estilos para el RatingComponent (Ahora Rating dentro del TimelineItem) --- */

.rating-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 5px;
    text-align: center;
    margin-top: 5px;
    border-top: 4px solid var(--accent-color);
}

    .rating-card h3 {
        color: var(--text-color);
        margin-bottom: 5px;
        font-size: 1.4rem;
        font-weight: 600;
    }

    .rating-card .subtitle {
        color: #6c757d;
        margin-bottom: 25px;
        font-size: 1rem;
    }

.star-rating {
    display: inline-block;
    margin-bottom: 20px;
    unicode-bidi: bidi-override;
    direction: rtl;
}

    .star-rating > i {
        color: #ced4da;
        font-size: 2.5rem;
        cursor: pointer;
        margin: 0 5px;
        transition: color 0.2s, transform 0.1s;
    }

        /* Estado al pasar el ratón (hover) y al seleccionar (checked) */
        .star-rating > i:hover,
        .star-rating > i:hover ~ i,
        .star-rating > .checked {
            color: var(--accent-color);
            transform: scale(1.1);
        }

.rating-message {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    min-height: 20px;
}

.submit-rating-button {
    background-color: #adb5bd;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

    .submit-rating-button:hover:not(:disabled) {
        background-color: #0056b3;
    }

    .submit-rating-button:disabled {
        background-color: #adb5bd;
        cursor: not-allowed;
    }
