/* ========================================
   APP HOME STYLES - COMPLETELY SEPARATE FILE
   ======================================== */

/* NUCLEAR OPTION - Hide ALL problematic elements */
.app-home h1,
.app-home .landing-tagline,
.app-home .tagline-line1,
.app-home .tagline-line2,
.app-home .landing-content,
.app-home .landing-logo,
.app-home .landing-buttons {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    font-size: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    color: transparent !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Force all text in app-home to be normal size */
.app-home * {
    font-size: inherit !important;
    line-height: normal !important;
    letter-spacing: normal !important;
    text-align: left !important;
    text-shadow: none !important;
    animation: none !important;
    font-family: 'Inter', sans-serif !important;
}

/* App Home Container */
.app-home {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    font-family: 'Inter', sans-serif;
    padding: 0;
    margin: 0;
    position: relative;
}

/* Header Styles */
.app-header {
    background: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-radius: 0 0 1rem 1rem;
    margin: 0 1rem;
}

.app-logo-small {
    display: flex;
    align-items: center;
}

.logo-small {
    max-width: 100px;
    height: auto;
    filter: brightness(0) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.user-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    margin-left: auto;
}

.user-info p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0.25rem 0 0 0;
}

/* Logout button removed */
.logout-btn {
    display: none !important;
    visibility: hidden !important;
}

/* Navigation Styles */
.app-nav {
    background: white;
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 1rem;
    border-radius: 1rem;
    padding: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 0.75rem;
    margin: 0.25rem;
}

.nav-btn:hover {
    color: #1e293b;
    background: #f8fafc;
}

.nav-btn.active {
    color: #1e293b;
    background: #ffd31b;
    box-shadow: 0 2px 8px rgba(255, 211, 27, 0.3);
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-text {
    font-size: 0.9rem;
}

/* Main Content Styles */
.app-main {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Coach Container Styles - Only Chat */
.coach-container {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    padding-bottom: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: calc(100vh - 300px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Chat Area Styles - Full Height */
.chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 2rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 0;
    border: 1px solid #e2e8f0;
    min-height: 400px;
    position: relative;
    z-index: 1;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: #ffd31b;
    box-shadow: 0 0 0 3px rgba(255, 211, 27, 0.1);
}

.chat-send-btn {
    background: #ffd31b;
    color: #1e293b;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #e6be18;
}

/* Chat Message Styles */
.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    max-width: 95%;
    word-wrap: break-word;
    position: relative;
    z-index: 1;
}

.chat-message.user {
    background: #ffd31b;
    color: #1e293b;
    margin-left: auto;
    margin-right: 2%;
    text-align: right;
    max-width: 93%;
}

.chat-message.assistant {
    background: #f1f5f9;
    color: #1e293b;
    margin-right: auto;
    margin-left: 2%;
    max-width: 93%;
}

.chat-message .message-sender {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.chat-message .message-content {
    font-size: 0.9rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .chat-message {
        max-width: 98%;
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .chat-message .message-content {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    max-width: 80%;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #64748b;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Weekly Plan Styles */
.plan-content {
    max-width: 1000px;
    margin: 0 auto;
}

.plan-header {
    margin-bottom: 2rem;
    text-align: center;
}

.plan-header h3 {
    color: #1e293b;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Training Dashboard */
.training-dashboard {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.dashboard-title h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.training-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.training-table th,
.training-table td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.training-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.training-table td {
    background: white;
}

.dashboard-actions {
    text-align: center;
}

.btn-introduce-plan {
    background: #ffd31b;
    color: #1e293b;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-introduce-plan:hover {
    background: #e6be18;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 211, 27, 0.3);
}

/* Plan Form */
.plan-form-container {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-header h4 {
    color: #1e293b;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close-form {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-form:hover {
    background: #dc2626;
}

.day-planning {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.day-section {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.day-section h5 {
    color: #1e293b;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.training-type {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: white;
}

.training-type:focus {
    outline: none;
    border-color: #ffd31b;
    box-shadow: 0 0 0 3px rgba(255, 211, 27, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.btn-save-plan,
.btn-cancel-plan {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-save-plan {
    background: #10b981;
    color: white;
}

.btn-save-plan:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-cancel-plan {
    background: #ef4444;
    color: white;
}

.btn-cancel-plan:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Multiple Trainings Styles */
.trainings-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.training-item {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.training-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.training-header label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.btn-remove-training {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-training:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn-add-training {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-add-training:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.day-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.training-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.85rem;
}

.detail-group input,
.detail-group select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    background: white;
}

.detail-group input:focus,
.detail-group select:focus {
    outline: none;
    border-color: #ffd31b;
    box-shadow: 0 0 0 3px rgba(255, 211, 27, 0.1);
}

/* Language Selector */
.language-selector {
    position: relative;
    bottom: auto;
    right: auto;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 0;
    padding: 4px;
    transition: all 0.3s ease;
    margin: 2rem auto;
    width: fit-content;
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.lang-btn:hover {
    background: #f1f5f9;
    color: #ffd31b;
}

.lang-btn.active {
    background: #ffd31b;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(255, 211, 27, 0.3);
}

/* Logout button in language selector */
.logout-btn-selector {
    padding: 8px 16px;
    border: none;
    background: #ef4444 !important;
    color: white !important;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 8px;
}

.logout-btn-selector:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.logout-btn-selector i {
    font-size: 0.9rem;
}

/* ========================================
   MEJORAS DE VISIBILIDAD Y USABILIDAD
   ======================================== */

/* Asegurar que todos los botones sean visibles y clickeables */
.nav-btn, .tab-btn, .chat-send-btn {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    touch-action: manipulation;
}

/* Mejorar visibilidad de navegación en móvil */
@media (max-width: 768px) {
    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tab-navigation::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        flex-shrink: 0;
        min-width: 80px;
        white-space: nowrap;
        padding: 0.875rem 1.25rem;
    }
    
    .tab-icon {
        font-size: 1.1rem;
        margin-right: 0.25rem;
    }
    
    .tab-text {
        display: inline;
    }
}

/* Chat - Asegurar mensajes visibles */
.chat-message {
    animation: slideIn 0.3s ease-out;
    margin-bottom: 1.25rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejorar contraste de mensajes */
.chat-message.user .message-content {
    background: linear-gradient(135deg, #ffd31b 0%, #ffe566 100%);
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(255, 211, 27, 0.3);
    font-weight: 500;
}

.chat-message.assistant .message-content {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Asegurar que el área de chat tenga altura adecuada */
.coach-container,
.coach-content .chat-section {
    min-height: 450px;
    height: auto;
    max-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
    .coach-container,
    .coach-content .chat-section {
        min-height: 400px;
        max-height: calc(100vh - 150px);
    }
}

/* Input del chat siempre visible */
.chat-input-container,
.chat-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .chat-messages {
        padding-bottom: 5rem;
        margin-bottom: 0;
        background: white;
    }
    
    /* Input area fijo pero dentro del contenedor */
    .chat-input-area {
        position: sticky;
        bottom: 0;
        background: white;
        border-radius: 0;
        padding: 0.75rem;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .coach-container {
        padding-bottom: 0;
    }
    
    /* Mejoras visuales de mensajes tipo WhatsApp - MÁS ANCHOS */
    .chat-message.user {
        margin-left: auto;
        margin-right: 0.5rem;
        margin-left: 5%;
        border-radius: 18px 18px 4px 18px;
        padding: 0.75rem 1rem;
        max-width: 95%;
    }
    
    .chat-message.assistant {
        margin-right: auto;
        margin-left: 0.5rem;
        margin-right: 5%;
        border-radius: 18px 18px 18px 4px;
        padding: 0.75rem 1rem;
        max-width: 95%;
    }
    
    /* Botón de enviar más grande y circular */
    .chat-send-btn {
        min-width: 44px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .chat-input {
        border-radius: 25px;
        padding: 0.875rem 1rem;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .chat-input-area {
        padding: 0.5rem;
    }
    
    .chat-message.user {
        margin-left: 3%;
        max-width: 97%;
    }
    
    .chat-message.assistant {
        margin-right: 3%;
        max-width: 97%;
    }
}

/* Header y logout siempre visibles */
.app-header,
.home-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
}

/* Logout button removed */

/* ========================================
   RESPONSIVE HEADER PARA MÓVIL
   ======================================== */

@media (max-width: 768px) {
    /* Header más compacto en móvil */
    .app-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Logo más pequeño en móvil */
    .app-logo-small {
        flex: 0 0 auto;
    }
    
    .logo-small {
        max-width: 80px;
    }
    
    /* Info del usuario ajustada */
    .user-info {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }
    
    .user-info h2 {
        font-size: 1.1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 180px;
        margin: 0;
        margin-left: auto;
    }
    
    .user-info p {
        display: none;
    }
    
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.5rem 0.75rem;
    }
    
    .logo-small {
        max-width: 70px;
    }
    
    .user-info h2 {
        font-size: 0.95rem;
        max-width: 140px;
        margin-left: auto;
    }
    
    .user-info p {
        display: none;
    }
}
