/* ============================================================ */
/* 1. VARIABLES Y RESET */
/* ============================================================ */
:root {
    --primary-dark: #273043;
    --secondary-dark: #353d54;
    --primary-light: #856194;
    --primary-hover: #72547e;
    --bg-body: #afb6d2;
    --bg-body-secondary: #7C88B6;
    --text-light: white;
    --text-muted: #888;
    --border-radius: 4px;
    --box-shadow: 5px 3px 4px rgba(158, 61, 6, 0.1);
    --dropdown-bg: #525C7D;
    --clicked-btn-bg: #654a6f;
    --font-main: Arial, sans-serif;
    --radius-lg: 10px;
    --panel-border: 6px solid var(--primary-dark);
    --color-low: #4f768f;
    --color-medium: #c9822b;
    --color-high: #b45c5c;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    overflow-x: hidden;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    filter: brightness(0.95);
}
/* ============================================================ */
/* 2. LAYOUT GLOBAL */
/* ============================================================ */
.container {
    width: 80%;
    margin: 0 auto;
    padding: 20px 0;
}

h1 {
    text-align: center;
    color: var(--primary-dark);
    font-size: 50px;
}

/* ============================================================ */
/* 3. HEADER (LOGIN / APP) */
/* ============================================================ */
.header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    background-color: var(--bg-body-secondary);
    box-shadow: var(--box-shadow);
    width: 100%;
    min-height: 88px;
    padding: 16px 24px;
}

.app-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    top: 0;
}

/* ============================================================ */
/* 4. LOGIN / REGISTER */
/* ============================================================ */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
}

.login-container > .header {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    margin-bottom: 0;
    margin-left: 0;
}

.login-container > .header .logo {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.login-container > .header .app-title {
    text-align: center;
}

.app-title {
    color: var(--primary-dark);
    margin-bottom: 0;
}

.app-container .container {
    width: 100%;
    padding-top: 0;
}

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-dark);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.login-title,
.register-title {
    color: var(--text-light);
    margin-bottom: 20px;
}

#username,
#password,
#regUsername,
#regEmail {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: none;
    border-radius: var(--border-radius);
}
#regPassword,
#regConfirmPassword {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}
.password-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.password-field {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

#showRegister,
#showLogin {
    background-color: transparent;
    color: var(--bg-body);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

/* ============================================================ */
/* 5. LAYOUT PRINCIPAL (APP) */
/* ============================================================ */
.main-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 30px;
}

.logout-btn {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.app-container .header {
    position: relative;
    display: flex;
    align-items: center;
    top: 0;
    padding: 16px 24px;
    margin-bottom: 30px;
}

.app-container .app-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
}

.app-container .app-header-logo {
    position: static;
}

.app-header-logo,
.app-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.calendar-section {
    min-width: 350px;
}

.task-creator {
    display: flex;
    flex-direction: column;
    border: var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.main-list {
    width: 60%;
    min-width: 500px;
    border: var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

/* ============================================================ */
/* 6. CALENDARIO */
/* ============================================================ */
.calendar-container {
    display: none;
}

.calendar-btn.clicked {
    background-color: var(--clicked-btn-bg);
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--primary-light);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

#monthYear {
    display: flex;
    align-items: center;
    font-size: 18px;
    color: var(--text-light);
}

#nextMonth,
#prevMonth {
    background-color: inherit;
}

#nextMonth:hover,
#prevMonth:hover {
    background-color: var(--primary-hover);
}

.calendar-table {
    width: 100%;
    border: 1px solid var(--primary-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

#calendarTable {
    width: 100%;
    border-collapse: collapse;
    background: var(--primary-dark);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

th {
    padding-top: 10px;
    color: white;
}

td {
    color: var(--text-light);
    text-align: center;
    padding: 10px;
}

.calendar-day {
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--box-shadow);
    border-radius: 20%;
}

.calendar-day.selected {
    background-color: var(--primary-hover);
    border-radius: 20%;
}

/* ============================================================ */
/* 7. FORMULARIOS (CREAR TAREA) */
/* ============================================================ */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;  /* Para que en móvil no se rompa, se apilen */
    gap: 10px;
    margin-bottom: 20px;
}
.tabs-wrapper {
    --tab-item-height: 35px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    background-color: var(--secondary-dark);
    padding: 5px 10px;
    border-radius: var(--border-radius);
    
}   
.tabs{
    display: flex;
    gap: 5px;
    flex-wrap:wrap;
    align-items: center;
}
.tabs-wrapper > .tabs,
.tabs-wrapper > #addTabBtn {
    min-height: var(--tab-item-height);
}

.tabs-wrapper > #addTabBtn {
    display: flex;
    align-items: center;
    justify-content: center;
}
.tab {
    background-color: transparent;
    color: var(--text-light);
    border-radius: var(--border-radius);
    padding: 6px 10px;
    outline: none;
}
.tab.active {
    background-color: transparent;
    color: #ffffff;
    outline: none;
}
.tab.editing-tab {
    background-color: var(--primary-hover);
    padding: 4px 8px;
}
.tab.editing-tab input {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    outline: none;
    width: 80px;
    height: 28px;
    padding: 4px 6px;
    box-sizing: border-box;
}
.edit-category-input{
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    outline: none;
    width: 80px;
    height: 28px;
    padding: 4px 6px;
    box-sizing: border-box;
}
.tab-item{
    display:flex;
    flex-direction: row;
    background-color: var(--primary-light);
    border-radius: var(--border-radius);
    align-items: center;
    min-height: var(--tab-item-height);
}
.tab-item.active {
    background-color: var(--clicked-btn-bg);
}
.tab-item button:hover {
    background-color: #72547e5d;
    transition: none;
    transform: none;
}
.tab-actions button{
    padding: 4px 6px;
    background-color: transparent;
    border-radius: 50%;
}
.input-group,
.button-group {
    display: flex;
    gap: 8px;
}

.input-group {
    justify-content: center;
    margin-bottom: 20px;
}

.input-group button {
    height: 40px;
    align-self: center;
}

.button-group {
    justify-content: flex-end;
    align-items: center;
}

/* ============================================================ */
/* 8. INPUTS Y TEXTAREA */
/* ============================================================ */
#taskText {
    width: 70%;
    padding: 10px;
    font-size: 16px;
    background-color: var(--primary-light);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
}

#taskText,
#taskDesc,
#editDesc {
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-size: 16px;
    padding: 10px;
}

#taskText::placeholder {
    color: #ffffff77;
}

#taskText::placeholder,
#taskDesc::placeholder,
#editDesc::placeholder {
    color: #ffffff77;
}

#taskText:focus {
    outline: none;
    background-color: var(--primary-hover);
}

#taskText:focus,
#editDesc:focus,
.edit-form .task-edit-value:focus,
select:focus {
    outline: none;
    background-color: var(--primary-hover);
}
#taskDesc:focus{
    outline: none;
    background-color: #72547ebf ;
}
#taskText:focus::placeholder {
    color: transparent;
}

#taskText:focus::placeholder,
#taskDesc:focus::placeholder,
#editDesc:focus::placeholder {
    color: transparent;
}

#taskDesc {
    min-height: 40px;
    width: 80%;
    resize: none;
    overflow-y: hidden;
    font-family: var(--font-main);
    background-color: #856194bf;
}

/* ============================================================ */
/* 9. DROPDOWN PERSONALIZADO (PRIORIDAD) */
/* ============================================================ */
.dropdown-button {
    position: relative;
    display: inline-block;
}

.prior-button {
    cursor: pointer;
}

.prior-button.clicked {
    background-color: var(--clicked-btn-bg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    color: var(--text-light);
    background-color: var(--bg-body-secondary);
    border: 1px solid var(--primary-dark);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-width: 75px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
    border: none;
    border-radius: var(--border-radius);
    left: -10px;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item.selected {
    background-color: var(--primary-hover);
}

.dropdown-item:hover {
    background-color: var(--primary-hover);
}

.dropdown-item:focus {
    background-color: var(--primary-light);
}

/* ============================================================ */
/* 10. BOTONES GENERALES */
/* ============================================================ */
button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: var(--primary-light);
    color: var(--text-light);
    border: none;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, transform 0.3s ease;
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
}

button i {
    color: var(--text-light);
    font-size: 16px;
}
/* ============================================================ */
/* 11. CIRCULO DE PRIORIDAD */
/* ============================================================ */
.priority-low {
    background-color: var(--color-low);
}
.priority-medium {
    background-color: var(--color-medium);
}
.priority-high {
    background-color: var(--color-high);
}
/* ============================================================ */
/* 12. LISTA DE TAREAS */
/* ============================================================ */
ul {
    list-style: none;
    padding: 0;
}

li {
    background-color: var(--primary-dark);
    margin-bottom: 10px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
    box-shadow: var(--box-shadow);
    color: var(--text-light);
    gap: 10px;
    flex-wrap: wrap;
}
.task-left{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex:1;
}
.task-right{
    display: flex;
    align-items: center;
    gap: 10px;
}
.right-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
}

li span {
    flex-grow: 1;
    cursor: pointer;
}

li span.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

p {
    color: var(--text-light);
    padding: 10px;
}

/* ============================================================ */
/* 13. FECHA DE VENCIMIENTO (DUE DATE) */
/* ============================================================ */
.due-date-label {
    font-size: 14px;
    color: var(--text-light);
    background-color: var(--secondary-dark);
    padding: 6px 10px;
    border-radius: var(--border-radius);
    margin-left: 10px;
    font-weight: bold;
}

/* ============================================================ */
/* 14. DROPDOWN DE PRIORIDAD (SELECT) */
/* ============================================================ */
.dropdown,
select {
    background-color: var(--dropdown-bg);
    color: var(--text-light);
    border: none;
    border-radius: var(--border-radius);
    padding: 5px;
    margin-right: 10px;
}

/* ============================================================ */
/* 15. CHECKBOX PERSONALIZADO */
/* ============================================================ */
.custom-checkbox {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 30px;
    height: 30px;
}

.custom-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.custom-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    background-color: var(--primary-light);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.custom-checkbox input:checked + .checkmark {
    background-color: var(--primary-hover);
}

.custom-checkbox input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-size: 18px;
}

.custom-checkbox:hover .checkmark {
    filter: brightness(0.9);
}

/* ============================================================ */
/* 16. BOTÓN ELIMINAR */
/* ============================================================ */
.delete-btn {
    background-color: var(--primary-light);
    padding: 5px 10px;
    border-radius: var(--border-radius);
}

.delete-btn:hover {
    background-color: var(--primary-hover);
}

.edit-btn {
    background-color: var(--primary-light);
    padding: 5px 10px;
    border-radius: var(--border-radius);
}
.edit-btn:hover {
    background-color: var(--primary-hover);
}

/* ============================================================ */
/* 17. MODALES (CONFIRMACIÓN / INFO TAREA / LOADING OVERLAY) */
/* ============================================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    gap : 16px;
}
.loading-spinner {
    border: 6px solid var(--primary-light);
    border-top: 6px solid var(--primary-hover);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
.loading-message {
    color: var(--text-light);
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}
@keyframes spin{
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.info-body {
    max-height: 400px;
    overflow-y: auto;
    width: auto;
    background-color: var(--secondary-dark);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.info-header {
    display: flex;
    align-items: center;
    text-align:center;
    justify-content: center;
    position: relative;
}

.task-text {
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
    max-width: 450px;

}
.confirmation,
.task-info,
.task-edit {
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(138, 143, 165, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.confirmation-content,
.task-info-content,
.task-edit-content {
    background-color: var(--primary-dark);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    min-width: 400px;
    max-width: 550px;
    width: fit-content;
}

.task-edit-content {
    width: min(92vw, 620px);
}

.task-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 10px;
}

.task-detail-label {
    flex: 0 0 100px;
}

.task-edit-label {
    flex: 0 0 100px;
    color: var(--text-light);
}

.task-edit-value {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.task-detail-value {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    align-self: flex-start;
    flex: 0 0 auto;
    width: auto;
    max-width: max-content;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 700;
    top: 30px;
}

.task-detail-inline-group {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    max-width: 400px;
}

.task-detail-inline-item {
    margin: 0;
    max-width: 200px;
}

.completed-badge {
    color: var(--text-light);
}

.task-completed-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-light);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.task-completed-checkbox.checked::after {
    content: "\2713";
    color: var(--text-light);
    font-size: 11px;
    line-height: 1;
}

.priority-low,
.priority-medium,
.priority-high {
    color: var(--text-light);
}

.info-footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 20px;
}

.edit-form {
    width: 100%;
    padding:0;
}

.task-detail-text {
    min-width: 60%;
    text-align: center;
    background-color: transparent;
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    padding: 8px 10px;
    font-size: 18px;
    font-weight: bold;
    outline: none;
}
.edit-form .info-body{
    width: auto;
    max-width: 100%;
}

.edit-form .task-detail-row {
    align-items: center;
}

.edit-form .task-edit-value {
    width: 100%;
    flex: 1;
    min-width: 0;
    background-color: var(--primary-light);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    padding: 8px 10px;
}
#editText {
    font-size: 28px;
    font-weight: bold;
}
#editDesc {
    min-height: 40px;
    width: 100%;
    resize: none;
    overflow-y: hidden;
    font-family: var(--font-main);
    box-sizing: border-box;
}

#editDate {
    max-width: 150px;
    width: 40%;
    padding: 8px 10px;
    font-size: 16px;
    font: inherit;
    background-color: var(--primary-light);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light);
    box-sizing: border-box;
}

#taskPrioritySelect {
    width: 100%;
    max-width: 100px;
    box-sizing: border-box;
}

.custom-checkbox {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 30px;
    height: 30px;
}

.custom-checkbox input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.custom-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    background-color: var(--primary-light);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.custom-checkbox input:checked + .checkmark {
    background-color: var(--primary-hover);
}

.custom-checkbox input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-size: 18px;
}

.custom-checkbox:hover .checkmark {
    filter: brightness(0.9);
}

.edit-form textarea.task-edit-value {
    min-height: 90px;
    resize: vertical;
    font-family: var(--font-main);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

.edit-form #cancelEdit {
    display: block;
}

#closeInfo{
    display: block;
}

#confirmClear,
#cancelClear {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

#confirmClear {
    background-color: #d9534f;
    color: white;
}

#confirmClear:hover {
    background-color: #c9302c;
}

#cancelClear {
    background-color: #5bc0de;
    color: white;
}

#cancelClear:hover {
    background-color: #31b0d5;
}

/* ============================================================ */
/* RESPONSIVE: Tablets y móviles grandes (≤ 1024px) */
/* ============================================================ */
@media (max-width: 1024px) {
    .container {
        width: 92%;
        padding: 16px 0;
    }

    .main-content {
        margin-left: 0;
        gap: 20px;
        flex-direction: column;  /* Apila las columnas */
    }
    .login-container > .header {
        padding: 12px 16px;
        min-height: auto;
        max-height: 60px;
        align-items: center;
    }
    .login-content {
        padding: 30px;
        margin: 0px 30px;
    }
    .calendar-section,
    .main-list {
        min-width: 0;
        width: 100%;
    }

    .task-creator,
    .main-list {
        padding: 16px;
        margin: 0px 30px;
    }

    .calendar-section {
        order: 1; /* Opcional: mueve el calendario debajo de la lista */
    }

    .main-list {
        order: 2;
        max-width: -webkit-fill-available;
    }

    .input-group {
        flex-wrap: wrap;
    }

    #taskText {
        flex: 1;
    }
    #taskDesc {
        flex:1
    }

    .button-group {
        justify-content: right;
    }

    .confirmation-content,
    .task-info-content,
    .task-edit-content {
        width: 90%;
        min-width: 0;
        padding: 20px;
    }
}

/* ============================================================ */
/* RESPONSIVE: Móviles (≤ 768px) */
/* ============================================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 38px;
    }

    .header {
        padding: 12px 16px;
        min-height: auto;
        max-height: 60px;
    }
    .login-container > .header {
        padding: 12px 16px;
        min-height: auto;
        max-height: 60px;
        align-items: center;
    }
    .login-content {
        padding: 30px;
    }

    .app-container .header {
        display: flex;
        flex-wrap: nowrap; 
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
    }

    .app-container .app-title {
        position: static;
        transform: none;
        width: auto;
        flex:1;
        text-align: center;
        margin:0;
        order: 2;
    }

    .logout-btn {
        position: static;
        transform: none;
        margin-left: 0;
        order: 3;
    }

    .app-header-logo {
        position: static;
        width: 40px;
        height: auto;
        order: 1;
    }

    .main-content {
        gap: 16px;
    }

    .task-creator,
    .main-list {
        padding: 12px;
    }

    .input-group,
    .button-group {
        gap: 8px;
    }

    .input-group button,
    .button-group button {
        padding: 8px 12px;
        font-size: 14px;
    }
    .list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .tabs{
        justify-content: flex-start;
    }
    .button-group {
        justify-content:flex-end;
    }
    #taskText,
    #taskDesc {
        font-size: 14px;
        padding: 8px;
    }

    li {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }
    .task-left {
        justify-content: flex-start;
    }
    .task-right {
        display:flex;
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
        margin-top: 8px;
        gap: 6px;
    }
    .right-buttons {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        width: 100%;
    }
    .due-date-label {
        align-self:flex-start;
        text-align: left;
    }
    .task-text {
        order:1

    }

    

    .edit-btn,
    .delete-btn,
    .custom-checkbox {
        width: 30px;
        height: 30px;
        order: 3;
        padding: 0;
    }

    .dropdown-menu {
        min-width: 100%;
        left: 0;
    }

    .calendar-table th,
    .calendar-table td {
        padding: 6px 4px;
        font-size: 12px;
    }

    .calendar-day:hover {
        transform: none; /* Evita efectos hover problemáticos en táctil */
    }

    .confirmation-content,
    .task-info-content,
    .task-edit-content {
        width: 95%;
        padding: 16px;
    }

    .task-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .task-detail-label,
    .task-edit-label {
        flex: none;
        width: auto;
    }

    .task-edit-value,
    #editDate,
    #taskPrioritySelect {
        width: 100%;
    }

    .info-footer {
        flex-direction: column;
        gap: 10px;
    }

    .info-footer button {
        width: 100%;
    }

    .priority-badge {
        font-size: 12px;
        padding: 2px 8px;
    }
}

/* ============================================================ */
/* RESPONSIVE: Móviles pequeños (≤ 480px) */
/* ============================================================ */
@media (max-width: 480px) {
    h1 {
        font-size: 28px;
    }

    .app-logo,
    .app-header-logo {
        width: 40px;
        height: 40px;
    }

    .task-creator,
    .main-list {
        padding: 10px;
    }

    .input-group button,
    .button-group button {
        padding: 6px 10px;
        font-size: 12px;
        width: 40px;
        height: 40px;
    }

    .dropdown-item {
        padding: 6px 10px;
        font-size: 14px;
    }

    .calendar-controls button {
        padding: 6px 10px;
    }

    #monthYear {
        font-size: 14px;
    }

    .confirmation-content p,
    .task-info-content p {
        font-size: 14px;
    }

    #editText {
        font-size: 20px;
    }

    .task-text-item {
        font-size: 18px;
    }
}

/* ============================================================ */
/* MEJORAS PARA TÁCTIL (móviles y tablets) */
/* ============================================================ */
@media (hover: none) and (pointer: coarse) {
    button,
    .calendar-day,
    .dropdown-item,
    .delete-btn,
    .edit-btn,
    .custom-checkbox {
        cursor: default;  /* Quita el cursor de mano en táctil */
    }

    button:hover {
        transform: none;  /* Evita efectos hover que pueden quedarse pegados */
    }

    /* Aumenta área táctil para botones pequeños */
    .delete-btn,
    .edit-btn,
    .custom-checkbox {
        min-width: 30px;
        min-height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}