/* =============================================
   GESTION DISPONIBILIDAD - Estilos
   ============================================= */

:root {
    --primary-blue: #4a7ba7;
    --secondary-blue: #5b8fb9;
    --light-blue: #e8f1f8;
    --success-green: #16a34a;
    --light-green: #dcfce7;
    --warning-orange: #f59e0b;
    --light-orange: #fef3c7;
    --danger-red: #ef4444;
    --light-red: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--gray-100);
    margin: 0;
    padding: 0;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    height: 36px;
    width: auto;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.back-btn,
.header-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.back-btn:hover,
.header-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

.back-btn svg,
.header-action svg {
    width: 22px;
    height: 22px;
}

/* CONTENT */
.content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* ALERT SUCCESS */
.alert-success {
    background: var(--light-green);
    color: var(--success-green);
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* INFO CARD */
.info-card {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: white;
}

.info-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon svg {
    width: 28px;
    height: 28px;
}

.info-text h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.info-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* TABS */
.tabs {
    display: flex;
    gap: 8px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary-blue);
    color: white;
}

.tab:hover:not(.active) {
    background: var(--gray-100);
}

/* TAB CONTENT */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* SECTION TITLE */
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

/* ADD SCHEDULE CARD */
.add-schedule-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.card-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary-blue);
}

.schedule-form .form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    min-width: 100px;
}

.form-group.flex-2 {
    flex: 2;
}

.form-group.flex-3 {
    flex: 3;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--secondary-blue);
}

.form-group input.hora-fin-calculada {
    background-color: var(--gray-100);
    color: var(--gray-600);
    cursor: not-allowed;
}

.btn-add {
    width: 100%;
    padding: 12px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-add:hover {
    background: var(--secondary-blue);
}

.btn-add svg {
    width: 18px;
    height: 18px;
}

.btn-add.btn-block {
    background: var(--danger-red);
}

.btn-add.btn-block:hover {
    background: #dc2626;
}

/* SCHEDULE LIST */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-day {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.schedule-day.inactive {
    opacity: 0.7;
}

.schedule-day .day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.day-name {
    font-weight: 600;
    color: var(--gray-800);
}

.day-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.day-status.active {
    background: var(--light-green);
    color: var(--success-green);
}

.day-status.inactive {
    background: var(--gray-200);
    color: var(--gray-500);
}

.time-blocks {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--light-blue);
    border-radius: 8px;
}

.time-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-info svg {
    width: 18px;
    height: 18px;
    color: var(--primary-blue);
}

.time-info span {
    font-size: 14px;
    color: var(--gray-700);
}

.duration-badge {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--primary-blue);
    font-weight: 500;
}

.btn-delete-small {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light-red);
    color: var(--danger-red);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-delete-small:hover {
    background: var(--danger-red);
    color: white;
}

.btn-delete-small svg {
    width: 16px;
    height: 16px;
}

.empty-day-message {
    padding: 20px;
    text-align: center;
    color: var(--gray-400);
    font-size: 14px;
}

/* BLOCKED LIST */
.blocked-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blocked-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.blocked-date {
    width: 60px;
    text-align: center;
    flex-shrink: 0;
}

.blocked-day {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger-red);
    display: block;
}

.blocked-month {
    font-size: 11px;
    color: var(--gray-500);
}

.blocked-info {
    flex: 1;
}

.blocked-reason {
    font-weight: 600;
    color: var(--gray-800);
    display: block;
    margin-bottom: 2px;
}

.blocked-weekday {
    font-size: 13px;
    color: var(--gray-500);
}

.empty-blocked {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.empty-blocked svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.empty-blocked p {
    margin: 0;
    font-size: 14px;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-blue);
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* RESERVATIONS LIST */
.reservations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reservation-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.reservation-card.history {
    opacity: 0.8;
}

.reservation-card.cancelled {
    opacity: 0.6;
}

.reservation-date {
    width: 55px;
    text-align: center;
    flex-shrink: 0;
}

.res-day {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    display: block;
}

.res-month {
    font-size: 11px;
    color: var(--gray-500);
}

.reservation-info {
    flex: 1;
}

.res-student {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.res-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.res-time svg {
    width: 14px;
    height: 14px;
}

.res-type {
    font-size: 12px;
    color: var(--gray-500);
}

.reservation-status {
    text-align: center;
}

.reservation-status span {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.reservation-status.pending span {
    background: var(--light-orange);
    color: var(--warning-orange);
}

.reservation-status.confirmed span {
    background: var(--light-green);
    color: var(--success-green);
}

.reservation-status.completed {
    width: 36px;
    height: 36px;
    background: var(--light-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success-green);
}

.reservation-status.completed svg {
    width: 20px;
    height: 20px;
}

.reservation-status.cancelled {
    width: 36px;
    height: 36px;
    background: var(--light-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger-red);
}

.reservation-status.cancelled svg {
    width: 20px;
    height: 20px;
}

/* TODAY TIMELINE */
.today-timeline {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    position: relative;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 55px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item:first-child::before {
    top: 50%;
}

.timeline-item:last-child::before {
    bottom: 50%;
}

.timeline-item.completed::before {
    background: var(--success-green);
}

.timeline-item.current::before {
    background: linear-gradient(to bottom, var(--success-green), var(--gray-200));
}

.timeline-time {
    width: 50px;
    font-weight: 600;
    color: var(--gray-600);
    text-align: right;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.timeline-item.completed .timeline-time {
    color: var(--success-green);
}

.timeline-item.current .timeline-time {
    color: var(--primary-blue);
}

.timeline-content {
    flex: 1;
    padding-left: 16px;
}

.timeline-student {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.timeline-type {
    font-size: 13px;
    color: var(--gray-500);
}

.timeline-item.completed .timeline-content {
    opacity: 0.7;
}

.timeline-status {
    width: 36px;
    text-align: center;
}

.timeline-item.completed .timeline-status {
    color: var(--success-green);
}

.timeline-item.completed .timeline-status svg {
    width: 22px;
    height: 22px;
}

.status-badge {
    background: var(--primary-blue);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: var(--light-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--danger-red);
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--gray-800);
}

.modal-content p {
    margin: 0 0 20px 0;
    color: var(--gray-600);
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.btn-cancel-modal {
    flex: 1;
    padding: 12px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-confirm-delete {
    flex: 1;
    padding: 12px;
    background: var(--danger-red);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ALERT ERROR */
.alert-error {
    background: var(--light-red);
    color: var(--danger-red);
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* REGENERATE SECTION */
.regenerate-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.btn-regenerate {
    width: 100%;
    padding: 12px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-regenerate:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

.btn-regenerate svg {
    width: 18px;
    height: 18px;
}

/* RESERVATION ACTIONS */
.reservation-actions {
    display: flex;
    gap: 8px;
    margin-right: 10px;
}

.btn-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-action svg {
    width: 18px;
    height: 18px;
}

.btn-action.confirm {
    background: var(--light-green);
    color: var(--success-green);
}

.btn-action.confirm:hover {
    background: var(--success-green);
    color: white;
}

.btn-action.cancel {
    background: var(--light-red);
    color: var(--danger-red);
}

.btn-action.cancel:hover {
    background: var(--danger-red);
    color: white;
}

/* MODAL CANCEL ICON */
.modal-icon.cancel {
    background: var(--light-red);
    color: var(--danger-red);
}

/* MODAL FORM */
.modal-content .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.modal-content .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.modal-content .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
}

.modal-content .form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-blue);
}

/* RESPONSIVE */
@media (max-width: 480px) {
    .header-title {
        font-size: 16px;
    }

    .schedule-form .form-row {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-value {
        font-size: 22px;
    }

    .timeline-item::before {
        left: 48px;
    }
}
