/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a6491;
    --secondary-color: #2c3e50;
    --accent-color: #17a2b8;
    --success-color: #28a745;
    --light-color: #f8f9fa;
    --dark-color: #333;
    --gray-color: #6c757d;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-color);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Pantalla de Login - COMPACTADA */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    padding: 15px;
}

.login-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
    margin: 10px;
}

.login-logo {
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.login-logo .logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.login-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.login-form {
    padding: 25px 20px;
}

.login-form h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 100, 145, 0.2);
}

.login-info {
    background-color: var(--light-color);
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid var(--primary-color);
    font-size: 0.85rem;
}

.login-info p {
    margin-bottom: 6px;
    color: var(--gray-color);
}

.login-info p:last-child {
    margin-bottom: 0;
}

.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 5px;
    border-radius: 6px;
    font-weight: 500;
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
    text-align: center;
    font-size: 0.85rem;
    min-height: 20px;
}

/* Instrucciones PWA */
.pwa-instructions {
    background-color: var(--light-color);
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid var(--accent-color);
    font-size: 0.8rem;
}

.pwa-tip {
    color: var(--gray-color);
    margin: 4px 0;
    padding-left: 8px;
    border-left: 2px solid #dee2e6;
}

/* Estilos para modo standalone (app instalada) */
@media all and (display-mode: standalone) {
    .container {
        border-radius: 0;
        min-height: 100vh;
    }
}

/* Estilos para la aplicación principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    flex-shrink: 0;
}

.header-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    margin-top: 3px;
    flex-wrap: wrap;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 25px;
    margin-top: 8px;
    flex-shrink: 0;
}

.month-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.month-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.current-month {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
}

#month-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.95rem;
    text-align: center;
    width: 100%;
    display: none;
}

#current-month-text {
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.3s;
    text-align: center;
    white-space: nowrap;
}

#current-month-text:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Contenedor de semanas - MEJORADO PARA MÓVIL */
.main-content {
    padding: 20px;
    flex: 1;
    width: 100%;
    overflow-x: hidden;
}

.weeks-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
}

.week-card {
    background-color: var(--light-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--shadow);
    border: 1px solid #e9ecef;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.week-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
    flex-wrap: wrap;
    gap: 8px;
}

.week-title {
    font-size: 1.1rem;
    color: var(--light-color);
    font-weight: 600;
    white-space: nowrap;
}

.week-range {
    font-size: 0.8rem;
    color: var(--light-color);
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Tabla de días - MEJORADA PARA MÓVIL */
.week-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    table-layout: fixed;
}

.week-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 4px;
    text-align: center;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
}

.week-table td {
    padding: 8px 4px;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
    font-size: 0.9rem;
}

.week-table tr:last-child td {
    border-bottom: none;
}

.week-table .day-name {
    font-weight: 600;
    color: var(--light-color);
    width: 80px;
    font-size: 0.85rem;
}

.time-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 100, 145, 0.2);
}

/* Botón para seleccionar praxis */
.praxis-btn {
    background-color: var(--gray-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 100px;
    max-width: 140px;
    margin: 0 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.praxis-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.praxis-btn i {
    font-size: 0.75rem;
}

/* Sección de notas semanales */
.week-notes {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #dee2e6;
}

.week-notes h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.week-notes textarea {
    width: 100%;
    height: 70px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    resize: vertical;
    box-sizing: border-box;
}

.week-notes textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 100, 145, 0.2);
}

/* Controles */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
    width: 100%;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    justify-content: center;
    box-sizing: border-box;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3a5378;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 100, 145, 0.3);
}

.btn-print {
    background-color: var(--accent-color);
    color: white;
}

.btn-print:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
}

/* Estilo para el contenedor de los créditos */
.developer-credits {
    /* Tipografía y color */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #f0f0f0; /* Texto blanco suave */
    
    /* Fondo y espaciado */
    background: linear-gradient(90deg, #1a1a1a, #2c3e50); /* Degradado oscuro y profesional */
    padding: 15px 25px; /* Relleno superior/inferior y a los lados */
    margin: 20px 0; /* Margen para separarlo de otros elementos */
    
    /* Bordes y alineación */
    border-radius: 8px; /* Bordes redondeados */
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); /* Sombra para darle profundidad */
    
    /* Transición (para el efecto hover) */
    transition: all 0.3s ease-in-out;
}

/* Estilo para el nombre del desarrollador (opcional, pero agrega énfasis) */
.developer-credits strong {
    font-weight: 700;
    color: #3498db; /* Color de acento (azul) */
    letter-spacing: 0.5px;
}

/* Efecto al pasar el ratón (Hover) */
.developer-credits:hover {
    /* Un ligero levantamiento y cambio de sombra */
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.7);
    background: linear-gradient(90deg, #2c3e50, #1a1a1a); /* Cambio de dirección del degradado */
}
/* FIN - Estilo para el contenedor de los créditos */

.last-saved {
    color: #b0b7c1;
    font-size: 0.8rem;
}

/* Modal general */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Modal específico para praxis */
.praxis-modal-content {
    max-width: 550px;
    width: 100%;
}

.praxis-modal-date {
    text-align: center;
    color: var(--gray-color);
    margin-bottom: 20px;
    font-style: italic;
    padding: 8px;
    background-color: var(--light-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.praxis-checkbox-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 6px;
    margin-bottom: 15px;
}

.form-check-inline {
    margin: 0;
    padding: 8px 12px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    box-sizing: border-box;
}

.form-check-inline:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 100, 145, 0.1);
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary-color);
    cursor: pointer;
}

/* Estilos para impresión */
@media print {
    .header, .controls, .footer, .month-btn, .btn-logout {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .week-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .time-input, .week-notes textarea {
        border: none;
        background: transparent;
        padding: 0;
        appearance: none;
    }
    
    .time-input:focus, .week-notes textarea:focus {
        outline: none;
        box-shadow: none;
    }
}

/* RESPONSIVE - MEJORADO */

/* Tablet */
@media (max-width: 1024px) {
    .weeks-container {
        gap: 15px;
    }
    
    .week-card {
        padding: 12px;
    }
    
    .week-title {
        font-size: 1rem;
    }
    
    .week-range {
        font-size: 0.75rem;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 12px 15px;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .header-title h1 {
        font-size: 1.2rem;
    }
    
    .user-info {
        justify-content: center;
        margin-top: 8px;
        gap: 10px;
    }
    
    .month-selector {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .current-month {
        min-width: 140px;
    }
    
    #current-month-text {
        font-size: 1.1rem;
    }
    
    .weeks-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .week-table {
        font-size: 0.85rem;
    }
    
    .week-table th {
        padding: 8px 3px;
        font-size: 0.8rem;
    }
    
    .week-table td {
        padding: 6px 3px;
    }
    
    .time-input {
        width: 65px;
        padding: 5px 6px;
        font-size: 0.8rem;
    }
    
    .praxis-btn {
        min-width: 90px;
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .controls {
        gap: 12px;
        margin: 20px 0;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
        min-width: 120px;
        max-width: 100%;
    }
    
    .footer {
        padding: 12px 15px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .praxis-checkbox-container {
        gap: 8px;
        padding: 12px;
    }
    
    .form-check-inline {
        min-width: 100px;
        padding: 6px 10px;
    }
    
    .form-check-label {
        font-size: 0.9rem;
    }
    
    .login-container {
        max-width: 400px;
        margin: 5px;
    }
    
    .login-logo, .login-form {
        padding: 20px 15px;
    }
    
    .login-logo h1 {
        font-size: 1.4rem;
    }
    
    .login-form h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
    }
    
    .header, .main-content, .footer {
        padding: 10px;
    }
    
    .week-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .week-table th,
    .week-table td {
        min-width: 70px;
    }
    
    .time-input {
        width: 60px;
        padding: 4px 5px;
        font-size: 0.75rem;
    }
    
    .praxis-btn {
        min-width: 80px;
        font-size: 0.7rem;
        padding: 4px 6px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .praxis-checkbox-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-check-inline {
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .login-container {
        border-radius: 8px;
    }
    
    .login-logo {
        padding: 20px 15px;
    }
    
    .login-logo .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .login-logo h1 {
        font-size: 1.2rem;
    }
    
    .login-subtitle {
        font-size: 0.8rem;
    }
    
    .input-group input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .btn-login {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .modal-content {
        padding: 15px;
        margin: 10px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-buttons .btn {
        width: 100%;
        margin: 0;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .header-title h1 {
        font-size: 1.1rem;
    }
    
    #current-month-text {
        font-size: 1rem;
    }
    
    .month-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .week-table th {
        font-size: 0.75rem;
        padding: 6px 2px;
    }
    
    .week-table td {
        padding: 5px 2px;
        font-size: 0.75rem;
    }
    
    .time-input {
        width: 55px;
        font-size: 0.7rem;
    }
    
    .praxis-btn {
        min-width: 70px;
        font-size: 0.65rem;
    }
}

/* Ajustes para landscape */
@media (max-height: 600px) and (orientation: landscape) {
    .login-screen {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
        overflow-y: auto;
    }
    
    .login-container {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .login-logo {
        padding: 15px 20px;
    }
    
    .login-form {
        padding: 15px 20px;
    }
}

/* Ajustes para pantallas grandes */
@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    .weeks-container {
        gap: 30px;
    }
    
    .week-card {
        padding: 25px;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .week-card:hover,
    .praxis-btn:hover,
    .btn:hover,
    .month-btn:hover {
        transform: none;
    }
}

/* Mejoras para dark mode (opcional) */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e0e0e0;
    }
    
    .login-container,
    .container,
    .modal-content {
        background-color: #2d3748;
        color: #e0e0e0;
    }
    
    .week-card {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .time-input,
    .week-notes textarea {
        background-color: #4b5563;
        border-color: #6b7280;
        color: #e0e0e0;
    }
    
    .form-check-inline {
        background-color: #4b5563;
        border-color: #6b7280;
    }
    
    .form-check-label {
        color: #e0e0e0;
    }
}