/* Alpine.js cloak helper */
[x-cloak] {
    display: none !important;
}

html {
    height: 100%;
}

/* General styles */
body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    margin-left: auto;
    margin-right: auto;
    flex-grow: 1;
}

/* Navbar styles */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.navbar-left .logo {
    height: 2.5rem;
}

.navbar-center .brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #16a34a; /* green-600 */
}

/* Filter bar styles */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    flex: 1 1 0%;
    min-width: 200px;
}

.filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.filter-select {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    background-color: white;
}

.filter-select i {
    position: absolute;
    left: 0.75rem;
    color: #9ca3af;
}

.filter-select select,
.filter-select input {
    padding-left: 2.5rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    width: 100%;
    background-color: transparent;
    outline: 2px solid transparent;
    outline-offset: 2px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.filter-select select {
    cursor: pointer;
}

.reset-button {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.reset-button:hover {
    background-color: #e5e7eb;
}

/* Person cards section */
.personas-section {
    margin-bottom: 2rem;
}

.personas-list {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .personas-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .personas-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .personas-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.persona-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.persona-card:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-0.25rem);
}

.persona-card.en-turno {
    background-color: #f0fdf4; /* green-50 */
    border-left: 4px solid #22c55e; /* green-500 */
}

.persona-card.no-disponible {
    background-color: #fef2f2; /* red-50 */
    border-left: 4px solid #ef4444; /* red-500 */
}

.persona-card-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.avatar {
    position: relative;
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    margin-right: 1rem;
    flex-shrink: 0;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #475569;
    border: 2px solid #d1d5db;
    background-size: cover;
    background-position: center;
}

.avatar.disponible {
    border-color: #22c55e;
}

.persona-info {
    flex-grow: 1;
    min-width: 0;
}

.persona-nombre {
    font-weight: 700;
    font-size: 1.125rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.persona-meta {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.persona-meta i {
    margin-right: 0.5rem;
}

.estado-chip {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 1rem;
    flex-shrink: 0;
}

.estado-chip.disponible {
    background-color: #dcfce7;
    color: #166534;
}

.estado-chip.gris {
    background-color: #f1f5f9;
    color: #475569;
}

/* Modal styles */
.modal-detalle {
    position: fixed;
    inset: 0;
    background-color: rgb(0 0 0 / 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    max-width: 42rem;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.cerrar-modal {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    color: #6b7280;
    font-size: 1.5rem;
    font-weight: 700;
    border: none;
    background: none;
    cursor: pointer;
}

.modal-header-flex {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.persona-foto.grande {
    width: 6rem;
    height: 6rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 4px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-header-flex h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.persona-meta.grande {
    font-size: 1rem;
}

.horario-actual {
    margin-top: 0.5rem;
    font-weight: 500;
    color: #4b5563;
}

.detalle-info {
    padding-top: 1rem;
}

.detalle-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.tabla-turnos {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tabla-turnos th, .tabla-turnos td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.tabla-turnos th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.day-cell {
    display: flex;
    flex-direction: column;
}

.day-name {
    font-weight: 600;
}

.day-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.hoy-row {
    background-color: #f0fdf4; /* green-50 */
}

.hoy-row .day-name {
    color: #15803d; /* green-700 */
}

.total-horas {
    text-align: right;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
}

.estado-actual {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
}

.estado-actual.en-turno {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.progress-bar-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 1.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    background-color: #22c55e;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    transition: width 0.5s ease-in-out;
}

.estado-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    background-color: #fee2e2;
    color: #991b1b;
}

.proximo-turno {
    margin-top: 0.5rem;
    font-weight: 500;
    color: #4b5563;
}

.estado-badge.vacaciones {
    background-color: #fef9c3;
    color: #854d0e;
}

.turno-actual-highlight {
    background-color: #16a34a; /* green-600 */
    color: white;
    font-weight: 700;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    display: inline-block;
}

/* Footer styles */
.footer {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: auto;
}

/* WhatsApp button */
.whatsapp-button {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: #25D366;
    color: white;
    font-weight: 600;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    text-decoration: none;
    transition: background-color 0.2s;
}

.whatsapp-button:hover {
    background-color: #128C7E;
}

.whatsapp-button.disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}

.whatsapp-button i {
    margin-right: 0.5rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-card {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #1f2937;
}

.loading-spinner {
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid #d1fae5;
    border-top-color: #22c55e;
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile tweaks */
@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .navbar-left .logo {
        height: 2rem;
    }

    .navbar-center {
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .reset-button {
        width: 100%;
        justify-content: center;
    }
}
