:root {
    --theme-speed: 0.6s ease-in-out;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--background);
    color: var(--text);
    transition: background-color var(--theme-speed), color var(--theme-speed);
}

/* --- NAVIGATION --- */
.top-nav {
    height: 60px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--contrast2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
}

#theme-select {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px;
    border-radius: 8px;
    outline: none;
}

/* --- LAYOUT & SCROLLS --- */
.app-container {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden; /* Evita scroll global */
}

.main-view {
    flex: 3;
    padding: 40px;
    overflow-y: auto; /* Scroll independiente */
    height: 100%;
}

.side-view {
    flex: 1;
    background: var(--contrast);
    padding: 20px;
    position: relative;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-header {
    padding: 15px;
}

/* Contenedor interno para que el scroll no afecte al título de Upcoming */
.upcoming-list {
    flex: 1;
    overflow-y: auto; /* Scroll independiente lateral */
    padding-right: 5px;
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* --- MODALS & OVERLAYS --- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.config-window {
    background: var(--contrast2);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-x {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- FORM ELEMENTS --- */
.k-input,
.k-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    margin-top: 5px;
    outline: none;
}

.main-input {
    font-size: 1.5rem;
    border-left: 4px solid var(--primary);
}

/* --- TASK CARDS --- */
.task-card {
    background: var(--contrast2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.2s;
}

.task-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.task-title-text {
    margin: 0;
    color: var(--primary);
}

.interval-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--background);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* --- BUTTONS --- */
.btn-primary {
    background: var(--primary);
    color: var(--background);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
}

.btn-danger {
    background: rgba(255, 85, 85, 0.1);
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.3);
    padding: 10px;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-danger:hover {
    background: #ff5555;
    color: white;
}

.fab {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    font-size: 2rem;
    color: var(--background);
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* --- UTILS --- */
.hidden {
    display: none !important;
}

.expired {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.expired-tag {
    background: rgba(255, 0, 0, 0.2);
    color: #ff5555;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 10px;
}