/* ============================================================
   UI POLISH CSS - Modern Improvements for Focus Mode & Tasks
   File: css/ui-polish.css
   ============================================================ */

/* ============================================================
   AI STUDY ASSISTANT - FOCUS MODE SECTION
   Cải thiện phần "Chế độ tập trung"
   ============================================================ */

/* Container chính với glassmorphism hiện đại */
#focus-mode .ai-study-tab-content {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#focus-mode .ai-study-tab-content:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Form inputs trong Focus Mode - Modern Style */
#focus-mode input[type="text"],
#focus-mode input[type="number"],
#focus-mode input[type="date"],
#focus-mode select,
#focus-mode textarea {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    font-size: 0.95rem !important;
    color: #1e293b !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

#focus-mode input:focus,
#focus-mode select:focus,
#focus-mode textarea:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.25),
        0 8px 25px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
    transform: translateY(-2px);
}

#focus-mode input:hover,
#focus-mode select:hover,
#focus-mode textarea:hover {
    border-color: rgba(102, 126, 234, 0.5) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Textarea cải thiện */
#focus-mode textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

#focus-mode textarea::-webkit-resizer {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 0 0 10px 0;
}

/* Labels trong Focus Mode */
#focus-mode .form-group label,
#focus-mode label[style*="color: white"] {
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
    margin-bottom: 8px !important;
    display: block !important;
}

/* Tabs cho AI Study Assistant */
.ai-study-tab {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

.ai-study-tab::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: left 0.5s ease;
}

.ai-study-tab:hover::before {
    left: 100%;
}

.ai-study-tab:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2) !important;
}

.ai-study-tab.active {
    box-shadow: 0 4px 20px rgba(118, 75, 162, 0.4) !important;
    transform: translateY(-1px);
}

/* Nút tạo kế hoạch với AI */
#focus-mode .btn-submit,
#btn-ai-study-plan,
#btn-ai-essay-outline,
#btn-ai-schedule {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#focus-mode .btn-submit:hover,
#btn-ai-study-plan:hover,
#btn-ai-essay-outline:hover,
#btn-ai-schedule:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 30px rgba(118, 75, 162, 0.5) !important;
}

#focus-mode .btn-submit:active,
#btn-ai-study-plan:active,
#btn-ai-essay-outline:active,
#btn-ai-schedule:active {
    transform: translateY(-1px) scale(0.98) !important;
}

/* ============================================================
   POMODORO TIMER SECTION - Clean & Simple
   ============================================================ */

/* Container chính cho Focus Mode */
#focus-mode-section {
    text-align: center;
}

/* AI Study Assistant giữ nguyên full width */
#focus-mode-section>div[style*="linear-gradient"] {
    text-align: left;
}

/* Wrapper cho Timer - tạo background card (TO HƠN 30%) */
.pomodoro-wrapper {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 30px;
    padding: 52px;
    margin: 40px auto;
    max-width: 650px;
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.18);
    border: 2px solid rgba(102, 126, 234, 0.1);
}

/* Pomodoro Timer - số đếm (TO HƠN 30%) */
#pomodoro-timer {
    font-size: 6rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 40px 0 !important;
    padding: 40px !important;
    letter-spacing: 5px;
    display: block;
    text-align: center;
    border-radius: 26px;
    background-color: white;
    position: relative;
}

/* Nền trắng cho timer */
#pomodoro-timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.12);
    z-index: -1;
}

/* Các nút điều khiển */
.focus-control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.focus-control-buttons button {
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.focus-control-buttons button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6) !important;
}

/* Settings: Phút làm việc / Phút nghỉ */
.focus-mode-settings {
    background: white !important;
    border-radius: 20px !important;
    padding: 30px !important;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.12);
    border: 2px solid rgba(102, 126, 234, 0.15);
    margin: 30px auto !important;
    max-width: 450px;
}

.focus-mode-settings .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.focus-mode-settings .form-group {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    text-align: center;
}

.focus-mode-settings .form-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
}

.focus-mode-settings .form-group label {
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    margin-bottom: 12px !important;
    display: block !important;
}

.focus-mode-settings input[type="number"] {
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #667eea !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.focus-mode-settings input[type="number"]:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
}

/* ============================================================
   TO-DO LIST / TASKS SECTION
   Cải thiện phần quản lý công việc
   ============================================================ */

/* Quick Add Container */
.quick-add-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9)) !important;
    border-radius: 14px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
}

.quick-add-container:hover,
.quick-add-container:focus-within {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

#quick-add-task-input {
    width: 100% !important;
    padding: 16px 20px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    background: white !important;
    transition: all 0.3s ease !important;
    color: #1e293b !important;
}

#quick-add-task-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
}

#quick-add-task-input::placeholder {
    color: #94a3b8;
}

/* Task Filter Buttons - Cải thiện */
.task-filter-controls .filter-btn {
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    border: 2px solid #e2e8f0 !important;
    background: white !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.task-filter-controls .filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.task-filter-controls .filter-btn:hover::before {
    width: 200%;
    height: 200%;
}

.task-filter-controls .filter-btn:hover {
    border-color: #667eea !important;
    color: #667eea !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2) !important;
}

.task-filter-controls .filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

/* Task Search Input */
#task-search {
    padding: 12px 18px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    background: white !important;
    transition: all 0.3s ease !important;
    min-width: 200px !important;
}

#task-search:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
}

/* Task Sort Select */
#task-sort {
    padding: 12px 18px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    background: white !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

#task-sort:focus,
#task-sort:hover {
    border-color: #667eea !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15) !important;
}

/* AI Quick Add Container - Cải thiện */
.ai-quick-add-container {
    position: relative;
    overflow: hidden;
}

.ai-quick-add-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ai-quick-add-container input[type="text"] {
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 14px 18px !important;
    font-size: 1rem !important;
    color: #1e293b !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease !important;
}

.ai-quick-add-container input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3),
        0 8px 25px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px);
}

/* AI Task Buttons */
#tasks [id^="btn-ai-"],
#tasks .btn-submit {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#tasks [id^="btn-ai-"]::after,
#tasks .btn-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#tasks [id^="btn-ai-"]:hover::after,
#tasks .btn-submit:hover::after {
    left: 100%;
}

#tasks [id^="btn-ai-"]:hover,
#tasks .btn-submit:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

/* Form Container trong Tasks */
#tasks .form-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95)) !important;
    border-radius: 16px !important;
    padding: 25px !important;
    margin-bottom: 25px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

#tasks .form-container input,
#tasks .form-container select,
#tasks .form-container textarea {
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    color: #1e293b !important;
}

#tasks .form-container input:focus,
#tasks .form-container select:focus,
#tasks .form-container textarea:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
}

/* Task List Container */
#task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#task-list>div {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95)) !important;
    border-radius: 14px !important;
    padding: 18px 22px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease !important;
}

#task-list>div:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15) !important;
    border-color: rgba(102, 126, 234, 0.2) !important;
}

/* ============================================================
   GLOBAL IMPROVEMENTS
   Các cải tiến chung
   ============================================================ */

/* Date inputs */
input[type="date"] {
    position: relative;
    background: white !important;
    padding: 12px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 5px;
    filter: opacity(0.6);
    transition: filter 0.3s ease;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator {
    filter: opacity(1);
}

/* Color inputs */
input[type="color"] {
    width: 50px !important;
    height: 50px !important;
    border: 3px solid #e2e8f0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    padding: 0 !important;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

input[type="color"]:hover {
    border-color: #667eea !important;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

/* Select dropdowns */
select {
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 20px !important;
    padding-right: 40px !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #667eea !important;
    outline-offset: 2px;
}

/* ============================================================
   RESPONSIVE IMPROVEMENTS
   ============================================================ */

@media (max-width: 768px) {
    .focus-mode-settings .form-grid {
        grid-template-columns: 1fr;
    }

    .focus-control-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .focus-control-buttons button {
        width: 100%;
    }

    #pomodoro-timer {
        font-size: 3rem !important;
    }

    .task-filter-controls {
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .task-filter-controls .filter-btn {
        flex-shrink: 0;
        padding: 8px 16px !important;
    }
}