/* Reset */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f9fafc;
    color: #1f2937;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 100px 20px 30px;
}

/* Header mejorado con efectos orgánicos */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(0);
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; transform: translateX(100%); }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    position: relative;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.navbar:hover::after {
    width: 80%;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.7rem;
    font-weight: 700;
    gap: 10px;
    color: #1f2937;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo i {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-2px) rotate(1deg); }
    66% { transform: translateY(1px) rotate(-1deg); }
}

.logo:hover {
    transform: scale(1.05);
}

.logo span {
    background: linear-gradient(135deg, #1f2937, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.menu-toggle {
    font-size: 1.8rem;
    background: none;
    border: none;
    color: #1f2937;
    cursor: pointer;
    z-index: 1001;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.menu-toggle:hover::before {
    width: 40px;
    height: 40px;
}

.menu-toggle:hover {
    color: #6366f1;
    transform: rotate(90deg);
}

/* Navegación mejorada */
.nav-links {
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    display: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1000;
    border-radius: 0 0 24px 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDown {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-links li {
    margin: 8px 0;
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.nav-links.open li:nth-child(1) { animation-delay: 0.1s; }
.nav-links.open li:nth-child(2) { animation-delay: 0.15s; }
.nav-links.open li:nth-child(3) { animation-delay: 0.2s; }
.nav-links.open li:nth-child(4) { animation-delay: 0.25s; }
.nav-links.open li:nth-child(5) { animation-delay: 0.3s; }
.nav-links.open li:nth-child(6) { animation-delay: 0.35s; }
.nav-links.open li:nth-child(7) { animation-delay: 0.4s; }

.nav-links a {
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: all 0.5s ease;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a i {
    margin-right: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.nav-links a:hover i {
    transform: scale(1.2) rotate(5deg);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* User info mejorada */
.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    font-size: 0.95rem;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    border: 1px solid rgba(79, 70, 229, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
}

.user-info:hover::before {
    left: 100%;
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    position: relative;
    overflow: hidden;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Footer completamente rediseñado y orgánico */
/* Footer visible y con más contraste */
footer {
    width: 100%;
    background: linear-gradient(135deg, #5b6ef5 0%, #6f3faa 50%, #e478fa 100%);
    color: white;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    padding: 50px 20px 30px;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    z-index: 5;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { 
        transform: translateX(-100%) scaleX(0);
        opacity: 0;
    }
    50% { 
        transform: translateX(0%) scaleX(1);
        opacity: 1;
    }
}

footer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: moveBackground 20s linear infinite;
    pointer-events: none;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20px, -20px) rotate(360deg); }
}

.footer {
    position: relative;
    z-index: 2;
}

.footer p {
    margin: 10px 0;
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer p:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* Botón más visible */
.footer button#enableNotifications {
    position: fixed;
    bottom: 30px;
    right: 25px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 700;
    border: none;
    padding: 14px 22px;
    border-radius: 25px;
    font-size: 1rem;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
    z-index: 999;
    cursor: pointer;
    animation: pulse 2s ease-in-out infinite;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.footer button#enableNotifications:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.6);
    animation: none;
}

/* Estado notificaciones */
#notifStatus {
    margin: 15px 0;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
    footer {
        padding: 40px 15px 20px;
    }
    .footer p {
        font-size: 0.9rem;
    }
}


#notifStatus:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Títulos */
h1 {
    text-align: center;
    margin: 30px auto;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1f2937;
    animation: fadeSlideDown 1s ease forwards;
    opacity: 0;
}

h2 {
    margin-top: 0;
    font-size: 1.6rem;
    color: #6366f1;
    font-weight: 600;
}

/* Tareas */
.tareas-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 30px 10px;
}

.tareas-list {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.tareas-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tareas-list li {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: background 0.3s, transform 0.3s;
}

.tareas-list li:hover {
    background: #e0f2fe;
    transform: scale(1.02);
}

/* Botones */
button {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

button:hover {
    transform: translateY(-4px);
}

/* Botones flotantes */
#addTaskBtn,
.taskBtnCal,
.floating-btn {
    position: fixed;
    right: 20px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: white;
    font-size: 1.8rem;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    text-align: center;
    line-height: 55px;
    transition: all 0.4s ease;
    z-index: 998;
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.3);
}

#addTaskBtn { bottom: 30px; }
.taskBtnCal { bottom: 95px; }
.btn-tareas { bottom: 30px; }
.btn-calendario { bottom: 100px; }

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay-content {
    background: white;
    padding: 25px;
    border-radius: 18px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

/* Form */
.overlay-content input, 
.overlay-content select,
.overlay-content textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.form-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.form-buttons button {
    flex: 1;
    margin: 0 5px;
}

/* Animaciones */
@keyframes fadeSlideDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* -------------------------------- */
/*        MEDIA QUERIES 📱         */
/* -------------------------------- */

@media (max-width: 768px) {

    .navbar {
        padding: 14px 18px;
    }

    h1 {
        margin: 20px auto;
        padding: 0 10px;
        font-size: 1.6rem;
        margin-top: 20px;
    }

    h2 {
        font-size: 1.3rem;
    }

    main {
        padding-top: 85px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .tareas-container {
        grid-template-columns: 1fr;
        padding: 15px 5px;
    }

    .tareas-list {
        padding: 15px;
    }

    .footer button#enableNotifications {
        bottom: 20px;
        right: 20px;
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    .menu-toggle {
        display: block;
        color: #1f2937;
        align-self: flex-end;
        position: relative;
        display: block;
    }

    .nav-links {
        list-style: none;
        flex-direction: column;
        max-width: 85%;
        position: absolute;
        top: 65px;
        left: 5%;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        display: none;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        padding: 25px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        margin: 10px 0;
        text-align: center;
    }

    .floating-btn {
        bottom: 80px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .nav-user {
        gap: 8px;
    }

    .user-info {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .logout-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    footer {
        padding: 30px 15px 15px;
    }

    #notifStatus {
        font-size: 0.9rem;
        margin: 12px 0;
    }
}

.title {
    position: relative;
    top: 40px;
    text-align: center;
    margin: 20px auto;
    font-size: 2.4rem;
    font-weight: 700;
    color: #1f2937;
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

/* Theme Switcher */
body.light {
  background-color: #f9fafc;
  color: #1f2937;
}

body.dark {
  background-color: #121212;
  color: #f3f4f6;
}

body.dark .main-header {
  background: rgba(30, 30, 30, 0.95) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark .main-header::before {
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
}

body.dark .overlay-content,
body.dark .tareas-list {
  background-color: #1e1e1e !important;
  color: #f3f4f6 !important;
}

body.dark footer {
  background: linear-gradient(135deg, #374151 0%, #4b5563 50%, #6b7280 100%) !important;
}

body.dark input,
body.dark select,
body.dark textarea {
  background-color: #2a2a2a;
  color: #f3f4f6;
  border: 1px solid #444;
}

body.dark .nav-links {
  background: rgba(30, 30, 30, 0.98) !important;
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark .tareas-list li {
  background-color: #2a2a2a;
  color: #f3f4f6;
}

body.dark .logo,
body.dark .nav-links a {
  color: #f3f4f6;
}

body.dark .logo i {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .logo span {
  background: linear-gradient(135deg, #f3f4f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .user-info {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

body.dark .logout-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

body.dark .logout-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

body.dark .title {
  color: #f3f4f6;
}

body.dark .floating-btn {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

body.dark .menu-toggle {
  color: #f3f4f6;
}

body.dark .nav-links a:hover {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}