@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #121212;
    --bg-card: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --accent-red: #FF6B6B;
    --accent-green: #4ECDC4;
    --accent-blue: #45B7D1;
    --accent-purple: #9D65C9;
    --accent-yellow: #F9DA78;
    --success: #2ECC71;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 100px;
    /* Space for FAB */
    -webkit-font-smoothing: antialiased;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 10px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    background: var(--bg-card);
    border: none;
    color: var(--text-secondary);
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.tab-btn.active {
    background: var(--text-primary);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.time-block {
    margin-bottom: 40px;
}

.time-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid currentColor;
}

.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Card Styles */
.card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s;
    border-left: 6px solid #444;
    /* Default */
}

.card:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: #333;
    border-radius: 10px;
    height: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--success);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.1, 0.7, 0.1, 1);
}

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

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    background-color: #333;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn-complete {
    background-color: var(--success);
    color: #000;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid #555;
    color: #DDD;
}

/* Subtasks */
.subtasks-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    padding: 5px 0;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--success);
}

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

/* Global Create Button */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: white;
    font-size: 34px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(69, 183, 209, 0.4);
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

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

/* Glassmorphism Effect */
.glass-effect {
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 30px 25px;
    border-radius: 25px;
    width: 90%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    top: 10%;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close {
    color: #888;
    position: absolute;
    right: 15px;
    top: 5px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: white;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 25px;
    margin-top: 25px;
}

.modal-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modal-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.modal-section.active {
    display: block;
}

/* Forms */
.input-group {
    margin-bottom: 18px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.input-group input,
.input-group select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.input-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.input-group input[type="date"],
.input-group input[type="time"],
.input-group input[type="datetime-local"] {
    min-height: 48px;
    display: block;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(69, 183, 209, 0.2);
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.input-row .input-group {
    flex: 1 1 150px; /* Base 150px, forzara wrap si no entra en la pantalla (< 315px) */
    min-width: 0;
}

@media (max-width: 600px) {
    .input-row {
        flex-direction: column;
        gap: 0;
    }
    .input-row .input-group {
        width: 100%;
        flex: none; /* Evita comportamientos extraños de flex en columna vertical */
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2b8cbb);
    color: white;
    font-size: 1.05rem;
    padding: 14px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(69, 183, 209, 0.4);
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(69, 183, 209, 0.4);
}

.w-100 {
    width: 100%;
}

.mt-3 {
    margin-top: 15px;
}

/* Subtask add input in cards */
.add-subtask-wrapper {
    display: flex;
    align-items: center;
    margin-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    padding-top: 12px;
    gap: 8px;
}

.add-subtask-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.add-subtask-input:focus {
    border-color: var(--accent-blue);
}

.add-subtask-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.add-subtask-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.add-subtask-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Enhancing Card aesthetic */
.card {
    background: linear-gradient(155deg, #252525, #1c1c1c);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.btn-delete {
    background: transparent;
    border: none;
    color: #FF5C5C;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.btn-delete:hover {
    opacity: 1;
    background: rgba(255, 92, 92, 0.15);
}