:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 20px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 40px 24px 60px;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-content p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.date-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

main {
    padding: 0 20px;
    margin-top: 0; /* Removed negative margin to give maximum space */
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.calendar-wrapper {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    color: var(--primary);
    transition: all 0.2s;
}

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

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.day:hover:not(.empty) { background: #f1f5f9; }
.day.active { background: var(--primary) !important; color: white !important; }
.day.today { border: 2px solid var(--primary); color: var(--primary); }

.day.type-holiday { background: #fee2e2; color: #dc2626; }
.day.type-vacation { background: #fef9c3; color: #ca8a04; }
.day.type-cte { background: #dcfce7; color: #16a34a; }
.day.type-weekend { color: #94a3b8; }

.selected-day-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
}

.selected-day-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.summary-cards {
    margin-top: 5px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.progress-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34d399);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-card p {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
    text-align: right;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: #e2e8f0;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.content-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    border-left: 5px solid transparent;
    transition: all 0.3s;
}

.item-card.completed {
    border-left-color: var(--success);
    opacity: 0.8;
}

.item-card.category-lenguajes { border-left-color: #8b5cf6; }
.item-card.category-saberes { border-left-color: #f59e0b; }
.item-card.category-etica { border-left-color: #10b981; }
.item-card.category-humano { border-left-color: #ec4899; }

.checkbox-container {
    display: flex;
    align-items: flex-start;
    padding-top: 4px;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.custom-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.custom-checkbox svg {
    color: white;
    display: none;
}

.custom-checkbox.checked svg {
    display: block;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.item-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-pink { background: #fce7f3; color: #9d174d; }

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

footer p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.whatsapp-btn {
    background: #25d366;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
}

.whatsapp-btn:active {
    transform: scale(0.9);
}

.whatsapp-btn svg {
    width: 20px;
    height: 20px;
}

/* Materials and Topics styling */
.material-card, .topic-card {
    background: white;
    padding: 16px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.material-card h4, .topic-card h4 {
    color: var(--primary);
    margin-bottom: 4px;
}

.material-card ul {
    list-style: none;
    padding-left: 4px;
}

.material-card li {
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.material-card li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
}
