/* ========================================
   Proyecto Manglar Dos - Colegio El Manglar
   Mobile-Only Design
   ======================================== */

/* ========================================
   Variables CSS
   ======================================== */
:root {
    /* Colores principales */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-dark: #1A1A1A;
    --color-gray-500: #666666;
    --color-gray-600: #999999;
    --color-gray-300: #E0E0E0;
    --color-gray-100: #F5F5F5;
    
    /* Verde primario */
    --color-primary: #4CAF50;
    --color-primary-light: #C8E6C9;
    --color-primary-dark: #388E3C;
    
    /* Amarillos */
    --color-yellow: #FFF9C4;
    --color-yellow-badge: #FFD700;
    
    /* Verdes para ilustraciones */
    --color-green-1: #4DB6AC;
    --color-green-2: #DCEDC8;
    --color-green-3: #A5D6A7;
    
    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Espaciado (baseline 8px) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 2px 6px rgba(76, 175, 80, 0.2);
}

/* ========================================
   Reset & Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-white);
    color: var(--color-dark);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ========================================
   Mobile Container
   ======================================== */
.mobile-container {
    max-width: 428px; /* iPhone 14 Pro Max width */
    margin: 0 auto;
    background-color: var(--color-white);
    min-height: 100vh;
    position: relative;
    padding-bottom: 84px; /* Space for bottom nav */
}

/* ========================================
   Header
   ======================================== */
.header {
    background-color: var(--color-white);
    padding: var(--space-4) var(--space-5) var(--space-3);
    padding-top: max(var(--space-4), env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.greeting {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.greeting-large {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-dark);
    line-height: 1.3;
}

.greeting-small {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-gray-500);
    line-height: 1.3;
}

.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-gray-500);
    transition: background-color 0.2s ease;
}

.notification-btn:active {
    background-color: var(--color-gray-100);
}

.notification-btn svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    padding: var(--space-5) var(--space-5);
}

/* ========================================
   Balance Card (Saldo Actual)
   ======================================== */
.balance-card {
    background: linear-gradient(135deg, var(--color-yellow), #FFECB3);
    border-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
    box-shadow: 0 4px 12px rgba(255, 249, 196, 0.3);
    margin-bottom: var(--space-6);
}

.balance-header {
    margin-bottom: var(--space-3);
}

.balance-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-body {
    margin-bottom: var(--space-5);
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.amount-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-black);
    line-height: 1;
}

.amount-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-actions {
    display: flex;
    gap: var(--space-3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 8px 16px;
    height: 36px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-outline {
    background-color: var(--color-white);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-light);
}

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

.btn-participate {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-primary);
    width: 100%;
    margin-top: var(--space-4);
}

.btn-participate:hover {
    background-color: var(--color-primary-dark);
}

.btn-participate:active {
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(76, 175, 80, 0.2);
}

/* ========================================
   Sections
   ======================================== */
.section {
    margin-bottom: var(--space-6);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-dark);
    line-height: 1.3;
}

.link-view-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.link-view-all:active {
    opacity: 0.7;
}

/* ========================================
   Activity Cards
   ======================================== */
.activity-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
    overflow: hidden;
}

.activity-image {
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-image.cleanup {
    background-color: var(--color-green-1);
}

.activity-image.tutoring {
    background-color: var(--color-green-2);
}

.activity-image.recycling {
    background-color: var(--color-green-3);
}

.reward-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 48px;
    height: 28px;
    padding: 0 10px;
    background-color: var(--color-yellow-badge);
    border-radius: 14px;
    border: 2px solid var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-black);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.activity-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-illustration svg {
    width: 80px;
    height: 80px;
}

.activity-content {
    padding: var(--space-4) var(--space-5);
}

.activity-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-dark);
    line-height: 1.3;
    margin-bottom: var(--space-2);
}

.activity-description {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-gray-500);
    line-height: 1.5;
    margin-bottom: var(--space-3);
}

.activity-slots {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.slots-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slots-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-dark);
}

/* ========================================
   Progress Bar
   ======================================== */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--color-gray-300);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease-in-out;
}

/* ========================================
   Bottom Spacer
   ======================================== */
.bottom-spacer {
    height: var(--space-4);
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 428px;
    background-color: var(--color-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: var(--space-3) 0;
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-2) var(--space-3);
    text-decoration: none;
    color: var(--color-gray-600);
    transition: color 0.2s ease;
    min-width: 64px;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    transition: stroke 0.2s ease;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.nav-item.active svg {
    stroke: var(--color-primary);
}

.nav-item:active {
    opacity: 0.7;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.balance-card {
    animation: fadeIn 0.4s ease-out;
}

.activity-card {
    animation: slideUp 0.4s ease-out;
}

.activity-card:nth-child(1) { animation-delay: 0.1s; }
.activity-card:nth-child(2) { animation-delay: 0.2s; }
.activity-card:nth-child(3) { animation-delay: 0.3s; }

/* ========================================
   Safe Area Support (iPhone X+)
   ======================================== */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(var(--space-5), env(safe-area-inset-left));
        padding-right: max(var(--space-5), env(safe-area-inset-right));
    }
    
    .main-content {
        padding-left: max(var(--space-5), env(safe-area-inset-left));
        padding-right: max(var(--space-5), env(safe-area-inset-right));
    }
    
    .bottom-nav {
        padding-left: max(var(--space-3), env(safe-area-inset-left));
        padding-right: max(var(--space-3), env(safe-area-inset-right));
    }
}

/* ========================================
   Active States & Interactions
   ======================================== */
.btn:active,
.link-view-all:active {
    opacity: 0.7;
}

.activity-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .bottom-nav,
    .notification-btn,
    .header {
        display: none;
    }
}
