/**
 * SaludEnCasa - Estilos Principales
 * Diseño optimizado para personas mayores
 */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --primary: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary: #1976D2;
    --secondary-light: #42A5F5;
    --danger: #C62828;
    --danger-light: #EF5350;
    --warning: #F57C00;
    --warning-light: #FFB74D;
    --success: #2E7D32;
    --success-light: #81C784;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ================================
   LAYOUT
================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 30px;
    padding-bottom: 100px;
}

/* ================================
   HEADER
================================ */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: white;
}

.app-logo-icon {
    font-size: 2rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-user-name {
    font-weight: 600;
}

.header-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ================================
   NAVIGATION
================================ */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 10px 20px;
    display: flex;
    justify-content: space-around;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-500);
    padding: 10px 15px;
    border-radius: var(--radius);
    transition: var(--transition);
    min-width: 80px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

.nav-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ================================
   CARDS
================================ */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

.card-footer {
    padding: 15px 25px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* ================================
   PROFILE CARDS (Dashboard)
================================ */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.profile-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    border: 3px solid transparent;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.profile-card.status-ok {
    border-color: var(--success-light);
}

.profile-card.status-pending {
    border-color: var(--warning-light);
}

.profile-card.status-alert {
    border-color: var(--danger-light);
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gray-200);
}

.profile-avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.profile-type {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.status-indicator.green {
    background: var(--success);
}

.status-indicator.yellow {
    background: var(--warning);
}

.status-indicator.red {
    background: var(--danger);
}

/* ================================
   MEDICATION LIST
================================ */
.med-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.med-item {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.med-item.tomado {
    background: #E8F5E9;
    border-color: var(--success-light);
}

.med-item.pendiente {
    background: #FFF3E0;
    border-color: var(--warning-light);
}

.med-photo {
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.med-photo-placeholder {
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.med-info {
    flex: 1;
}

.med-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.med-dose {
    color: var(--gray-600);
    font-size: 1rem;
}

.med-time {
    font-size: 0.95rem;
    color: var(--gray-500);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.med-action {
    flex-shrink: 0;
}

/* ================================
   BUTTONS
================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-lg {
    padding: 20px 40px;
    font-size: 1.3rem;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-light));
    color: white;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-tomado {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
    padding: 18px 35px;
    font-size: 1.2rem;
    min-width: 180px;
}

.btn-tomado.active {
    background: var(--gray-300);
    color: var(--gray-600);
}

.btn-tomado.active::before {
    content: '✓ ';
}

/* ================================
   FORMS
================================ */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
}

.form-control-lg {
    padding: 20px 25px;
    font-size: 1.3rem;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.input-group .form-control {
    flex: 1;
}

/* ================================
   MOOD SELECTOR (Caritas)
================================ */
.mood-selector {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
}

.mood-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    border: 3px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    background: white;
    min-width: 100px;
}

.mood-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.mood-option.selected {
    border-color: var(--primary);
    background: #E8F5E9;
}

.mood-option input {
    display: none;
}

.mood-emoji {
    font-size: 3rem;
    margin-bottom: 8px;
}

.mood-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
}

/* ================================
   VITALS INPUT
================================ */
.vitals-section {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 25px;
    margin: 20px 0;
}

.vitals-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vitals-input-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.vitals-input {
    width: 100px;
    padding: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
}

.vitals-separator {
    font-size: 2rem;
    color: var(--gray-400);
}

.vitals-unit {
    font-size: 1rem;
    color: var(--gray-500);
}

/* ================================
   ALERTS & MESSAGES
================================ */
.alert {
    padding: 20px 25px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

.alert-icon {
    font-size: 1.8rem;
}

.alert-success {
    background: #E8F5E9;
    border-left: 5px solid var(--success);
    color: var(--primary-dark);
}

.alert-warning {
    background: #FFF3E0;
    border-left: 5px solid var(--warning);
    color: #E65100;
}

.alert-danger {
    background: #FFEBEE;
    border-left: 5px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: #E3F2FD;
    border-left: 5px solid var(--secondary);
    color: #0D47A1;
}

/* ================================
   DATE DISPLAY
================================ */
.date-display {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.date-day {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.date-full {
    font-size: 1.1rem;
    color: var(--gray-600);
}

/* ================================
   GREETING
================================ */
.greeting {
    margin-bottom: 30px;
}

.greeting-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-800);
}

.greeting-name {
    color: var(--primary);
}

.greeting-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    margin-top: 5px;
}

/* ================================
   LOGIN PAGE
================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 50px;
    width: 100%;
    max-width: 450px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.login-logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.login-logo-subtitle {
    color: var(--gray-500);
}

/* ================================
   DOCTORS LIST
================================ */
.doctor-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
}

.doctor-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
}

.doctor-info {
    flex: 1;
}

.doctor-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.doctor-specialty {
    color: var(--gray-500);
    margin-bottom: 10px;
}

.doctor-contact {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.doctor-contact a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ================================
   TABLES
================================ */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 700;
    color: var(--gray-700);
}

.table tr:hover td {
    background: var(--gray-50);
}

/* ================================
   UTILITIES
================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex { display: flex; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none; }

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .main-content {
        padding: 20px;
        padding-bottom: 100px;
    }
    
    .app-header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .mood-selector {
        gap: 10px;
    }
    
    .mood-option {
        min-width: 80px;
        padding: 12px 15px;
    }
    
    .mood-emoji {
        font-size: 2.5rem;
    }
    
    .vitals-input-row {
        justify-content: center;
    }
    
    .btn-tomado {
        width: 100%;
    }
    
    .nav-item {
        min-width: 60px;
        padding: 8px 10px;
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
    
    .nav-label {
        font-size: 0.75rem;
    }
}

/* ================================
   PRINT
================================ */
@media print {
    .nav-bottom,
    .app-header,
    .btn {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
