:root {
    --bg-gradient: linear-gradient(135deg, #1e1e2f 0%, #2a2a40 100%);
    --sidebar-bg: rgba(20, 20, 30, 0.85);
    --main-bg: rgba(30, 30, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent-color: #ff7eb3;
    --accent-hover: #ff758c;
    --task-bg: rgba(255, 255, 255, 0.05);
    --task-hover: rgba(255, 255, 255, 0.1);
    --success: #4cd137;
    --danger: #ff4757;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* Evitar scroll en body, usar scroll interno */
    color: var(--text-primary);
    display: flex;
}

.dashboard-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.hidden {
    display: none !important;
}

/* LANDING PAGE */
.landing-layout {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-gradient);
    overflow-y: auto;
    padding: 2rem 1rem;
}

.landing-content {
    margin: auto;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: slideIn 0.5s ease forwards;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.landing-brand .logo-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.landing-brand h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    background: -webkit-linear-gradient(45deg, #fff, #a5a5b5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.clerk-container {
    width: 100%;
    display: flex;
    justify-content: center;
    min-height: 400px;
    /* Previene salto de layout mientras carga Clerk */
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-color);
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.login-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0;
    position: relative;
}

.login-btn i {
    font-size: 1.1rem;
}

.login-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.1rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.filter-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.filter-btn:hover {
    background: var(--task-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(255, 126, 179, 0.1);
    color: var(--accent-color);
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 1rem;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.sidebar-action-btn:hover {
    background: var(--task-hover);
    color: var(--text-primary);
}

.sidebar-action-btn.danger:hover {
    color: var(--danger);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    background: var(--main-bg);
    display: flex;
    flex-direction: column;
    padding: 3rem 5%;
    overflow-y: auto;
}

.main-header {
    margin-bottom: 3rem;
}

.main-header h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: -webkit-linear-gradient(45deg, #fff, #a5a5b5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-header p {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 400;
}

.input-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
}

#task-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-family: inherit;
}

#task-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#task-input:focus {
    outline: none;
}

.input-row {
    display: flex;
    gap: 15px;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

.datetime-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

#task-datetime {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

#task-datetime::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
    cursor: pointer;
}

#add-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 2rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    /* Empuja el botón a la derecha */
}

#add-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 126, 179, 0.3);
}

/* TASKS LIST */
.tasks-container {
    flex: 1;
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background: var(--task-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease forwards;
    backdrop-filter: blur(5px);
}

.task-item:hover {
    background: var(--task-hover);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.checkbox {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.task-item:hover .checkbox {
    border-color: var(--accent-color);
}

.task-item.completed .checkbox {
    background: var(--success);
    border-color: var(--success);
}

.checkbox i {
    color: white;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-item.completed .checkbox i {
    opacity: 1;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.task-text {
    font-size: 1.2rem;
    font-weight: 400;
    word-break: break-word;
    transition: all 0.3s ease;
}

.task-date {
    font-size: 0.9rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 8px;
}

.delete-btn:hover {
    color: var(--danger);
    background: rgba(255, 71, 87, 0.1);
}

/* Custom Scrollbar for main content */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
    transform: scale(0.9);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

#summary-month-text {
    color: var(--accent-color);
    margin-bottom: 2rem;
    font-size: 1.2rem;
    text-transform: capitalize;
}

.summary-stats {
    display: flex;
    justify-content: center;
}

.stat-box {
    background: var(--task-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
}

.stat-number {
    display: block;
    font-size: 4rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 4rem 0;
    font-size: 1.2rem;
    font-style: italic;
}

.summary-details {
    margin-top: 2rem;
    text-align: left;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.summary-details h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.summary-task-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 5px;
}

.summary-task-list::-webkit-scrollbar {
    width: 6px;
}

.summary-task-list::-webkit-scrollbar-track {
    background: transparent;
}

.summary-task-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.summary-task-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.summary-task-item .task-text {
    color: var(--text-primary);
    text-decoration: none;
}

.summary-task-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Eliminados estilos de login antiguo */

.logged-in-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--accent-color) !important;
    background: rgba(255, 126, 179, 0.1) !important;
    border: 1px solid rgba(255, 126, 179, 0.2) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 20px !important;
    width: auto !important;
    height: auto !important;
    font-size: 1rem !important;
}

.logged-in-user i {
    font-size: 1.1rem;
}