/* ==========================================
   JOHN ANDREWS 2DO CALEB - Estilos Principales
   Paleta: Colores vivos, modo claro, diseño para niños
   ========================================== */

:root {
    --yellow: #FFD93D;
    --orange: #FF9F43;
    --pink: #FF6B9D;
    --red: #FF6B6B;
    --teal: #48CAE4;
    --green: #7ED56F;
    --purple: #C77DFF;
    --blue: #4B6EF5;
    --white: #FFFFFF;
    --bg: #F8FAFF;
    --text: #2D3436;
    --text-light: #636E72;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 8px 30px rgba(0,0,0,0.10);
    --shadow-hover: 0 16px 48px rgba(0,0,0,0.16);
}

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

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

/* ---- STAR BACKGROUND ---- */
.stars-bg {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    overflow: hidden;
}
.star {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    opacity: 0.15;
    animation: floatStar 8s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.4s);
    left: calc(var(--i) * 5.2%);
    top: calc(var(--i) * 4.8%);
    background: #7B61FF;
}
.star:nth-child(even) { background: #FF6B6B; width: 6px; height: 6px; }
.star:nth-child(3n) { background: #FFD93D; width: 10px; height: 10px; }
@keyframes floatStar {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

/* ---- HEADER ---- */
.site-header {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    padding: 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    max-width: 1400px;
    margin: 0 auto;
}
.header-logo { display: flex; align-items: center; gap: 16px; }
.logo-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.site-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.9rem;
    line-height: 1;
    text-shadow: 2px 3px 0 rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}
.site-sub {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 600;
}
.header-mascot {
    font-size: 4rem;
    animation: wiggle 3s ease-in-out infinite;
}
@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* ---- ANNOUNCEMENT ---- */
.announcement-bar {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255,255,255,0.25);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}
.ann-emoji { font-size: 1.4rem; flex-shrink: 0; }
.announcement-bar p {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    line-height: 1.4;
}

/* ---- WEEK NAV ---- */
.week-nav-wrap {
    background: white;
    border-bottom: 2px solid #E8ECF4;
    padding: 16px 24px;
    position: sticky; top: 0; z-index: 9;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.week-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.week-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
    white-space: nowrap;
}
.week-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.4);
}
.week-title-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}
.week-label { font-size: 0.8rem; color: var(--text-light); font-weight: 600; }
.week-title-box strong { font-size: 1.05rem; color: var(--text); }
.badge-current {
    background: #7ED56F;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px 60px;
    position: relative; z-index: 1;
}

/* ---- DAYS GRID ---- */
.days-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    align-items: start;
}

/* ---- DAY COLUMN ---- */
.day-column {
    background: var(--day-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}
.day-column.is-today {
    border-color: var(--day-color);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 0 0 3px color-mix(in srgb, var(--day-color) 25%, transparent);
    transform: translateY(-4px);
}

.day-header {
    padding: 14px 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    position: relative;
}
.day-emoji { font-size: 1.8rem; flex-shrink: 0; }
.day-info { flex: 1; }
.day-name {
    display: block;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    line-height: 1;
}
.day-date { font-size: 0.82rem; opacity: 0.9; font-weight: 600; }
.today-badge {
    background: white;
    color: var(--day-color);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* ---- DAY TASKS AREA ---- */
.day-tasks { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }

/* ---- NO TASKS ---- */
.no-tasks {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 10px;
    color: #B2BEC3;
    text-align: center;
}
.no-tasks-icon { font-size: 2.2rem; margin-bottom: 8px; }
.no-tasks p { font-size: 0.85rem; font-weight: 600; line-height: 1.4; }

/* ---- TASK CARD ---- */
.task-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 14px 14px 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 12px rgba(0,0,0,0.07);
    position: relative;
    overflow: hidden;
}
.task-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-hover);
}
.task-card:active { transform: scale(0.98); }
.task-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 40px; height: 40px;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.6), transparent);
}
.task-important-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF9F43, #FF6B6B);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.task-subject-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.task-emoji { font-size: 1.1rem; }
.task-subject { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.task-title { font-size: 0.92rem; font-weight: 800; color: var(--text); margin-bottom: 5px; line-height: 1.3; }
.task-preview { font-size: 0.78rem; color: var(--text-light); line-height: 1.4; margin-bottom: 8px; }
.task-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; }
.task-due { font-size: 0.72rem; color: var(--text-light); font-weight: 700; }
.task-more { font-size: 0.78rem; font-weight: 800; text-decoration: none; }

.day-footer {
    text-align: center;
    padding: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    border-top: 2px dashed;
    border-color: var(--day-color);
    opacity: 0.8;
}

/* ---- MODAL ---- */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(44,44,84,0.55);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: white;
    border-radius: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    position: relative;
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn {
    from { transform: scale(0.7) translateY(30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: rgba(0,0,0,0.08);
    border: none;
    border-radius: 50%;
    width: 34px; height: 34px;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    color: var(--text);
    transition: all 0.2s;
    z-index: 10;
}
.modal-close:hover { background: #FF6B6B; color: white; transform: rotate(90deg); }

.modal-header {
    padding: 28px 28px 20px;
    border-radius: 24px 24px 0 0;
}
.modal-subject-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-emoji { font-size: 2.2rem; }
.modal-subject { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: white; }
.modal-important-badge {
    display: inline-block;
    background: rgba(255,255,255,0.3);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-left: 8px;
}
.modal-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    color: white;
    text-shadow: 1px 2px 0 rgba(0,0,0,0.15);
    line-height: 1.2;
    margin-bottom: 8px;
}
.modal-date { font-size: 0.85rem; color: rgba(255,255,255,0.85); font-weight: 600; }

.modal-body { padding: 20px 28px 10px; }
.modal-section { margin-bottom: 18px; }
.section-label {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.modal-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    background: #F8FAFF;
    border-radius: var(--radius-sm);
    padding: 14px;
}
.modal-materials {
    background: #FFFBEE;
    border: 2px dashed #FFD93D;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #7B6000;
    font-weight: 600;
    line-height: 1.6;
}
.modal-due {
    background: #F0F8FF;
    border: 2px solid #48CAE4;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 800;
    color: #0369a1;
}
.modal-footer-emoji {
    text-align: center;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #6c5ce7;
    border-top: 2px dashed #EDE9FF;
    margin: 0 28px 20px;
    border-radius: 0 0 16px 16px;
}

/* ---- SITE FOOTER ---- */
.site-footer {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    padding: 20px 32px;
    position: relative; z-index: 1;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.footer-inner p { font-size: 0.9rem; font-weight: 600; opacity: 0.9; }
.admin-link {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    transition: all 0.2s;
}
.admin-link:hover { background: rgba(255,255,255,0.15); color: white; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #C77DFF; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #764BA2; }

/* ==========================================
   ADMIN STYLES
   ========================================== */
.admin-page {
    min-height: 100vh;
    background: #F0F2FF;
}
.admin-header {
    background: linear-gradient(135deg, #2D3436, #636E72);
    color: white;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.admin-header h1 { font-family: 'Fredoka One', cursive; font-size: 1.4rem; }
.admin-nav { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-nav a, .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: 'Nunito', sans-serif;
}
.btn-primary { background: #667EEA; color: white; box-shadow: 0 4px 12px rgba(102,126,234,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102,126,234,0.4); }
.btn-success { background: #7ED56F; color: white; box-shadow: 0 4px 12px rgba(126,213,111,0.3); }
.btn-success:hover { transform: translateY(-2px); }
.btn-danger { background: #FF6B6B; color: white; }
.btn-danger:hover { background: #e55353; }
.btn-secondary { background: white; color: var(--text); border: 2px solid #DDE; }
.btn-secondary:hover { background: #F5F5FF; }
.btn-warning { background: #FFD93D; color: #7B6000; }
.admin-nav a { background: rgba(255,255,255,0.15); color: white; }
.admin-nav a:hover { background: rgba(255,255,255,0.25); }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }

.card {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.card-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px dashed #EEE;
}

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid #E8ECF4;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s;
    background: white;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667EEA;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }

/* Color picker */
.color-options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.color-opt {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.color-opt.selected, .color-opt:hover { transform: scale(1.2); border-color: #333; }
.color-opt.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: 900;
}

/* Task list in admin */
.tasks-table { width: 100%; border-collapse: collapse; }
.tasks-table th {
    text-align: left;
    padding: 10px 16px;
    background: #F5F5FF;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 800;
    border-bottom: 2px solid #E8ECF4;
}
.tasks-table td { padding: 12px 16px; border-bottom: 1px solid #F0F0F0; font-size: 0.9rem; }
.tasks-table tr:hover td { background: #F8FAFF; }
.subject-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
}
.important-tag {
    display: inline-block;
    background: #FF9F43;
    color: white;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 6px;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    background: white;
    border-radius: 28px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.2);
    text-align: center;
}
.login-icon { font-size: 4rem; margin-bottom: 16px; }
.login-title { font-family: 'Fredoka One', cursive; font-size: 1.8rem; color: var(--text); margin-bottom: 6px; }
.login-sub { color: var(--text-light); font-size: 0.9rem; margin-bottom: 32px; }
.login-box .form-group { text-align: left; }
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 16px;
}
.alert-error { background: #FFF0F0; color: #c0392b; border: 2px solid #FFD7D7; }
.alert-success { background: #F0FFF0; color: #27ae60; border: 2px solid #B7F7C2; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .days-grid { grid-template-columns: repeat(3, 1fr); }
    .days-grid .day-column:nth-child(4),
    .days-grid .day-column:nth-child(5) { grid-column: span 1; }
}
@media (max-width: 700px) {
    .days-grid { grid-template-columns: 1fr 1fr; }
    .header-inner { padding: 14px 16px; }
    .site-title { font-size: 1.3rem; }
    .header-mascot { font-size: 2.5rem; }
    .week-nav { flex-direction: column; gap: 10px; }
    .week-btn { width: 100%; justify-content: center; }
    .form-row { grid-template-columns: 1fr; }
    .admin-header { flex-direction: column; gap: 12px; }
}
@media (max-width: 480px) {
    .days-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, .star, .logo-icon, .header-mascot { animation: none !important; transition: none !important; }
}
