﻿/* CSS Variables for Anime Theme */
:root {
    --primary-pink: #ff9a9e;
    --primary-purple: #a8dcf0;
    --accent-blue: #667eea;
    --soft-white: #fefefe;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #495057;
    --success-green: #51cf66;
    --warning-orange: #ffa726;
    --shadow-light: rgba(255, 154, 158, 0.15);
    --shadow-medium: rgba(102, 126, 234, 0.2);
    --gradient-main: linear-gradient(135deg, var(--primary-pink) 0%, var(--primary-purple) 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    --border-radius: 20px;
    --border-radius-small: 12px;
    --font-main: 'Quicksand', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
    font-family: var(--font-main);
    background: var(--gradient-main);
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100); /* iOS Safari fix */
    color: var(--dark-gray);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation; /* Improve touch responsiveness */
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="a" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.1)"/><stop offset="100%" style="stop-color:rgba(255,255,255,0)"/></radialGradient></defs><circle cx="20" cy="20" r="2" fill="url(%23a)"><animate attributeName="cy" values="20;80;20" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="80" r="3" fill="url(%23a)"><animate attributeName="cx" values="80;20;80" dur="4s" repeatCount="indefinite"/></circle><circle cx="50" cy="30" r="1" fill="url(%23a)"><animate attributeName="r" values="1;4;1" dur="2s" repeatCount="indefinite"/></circle></svg>') repeat;
    animation: float 20s infinite linear;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100px); }
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    background: inherit;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.35);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.time-zone-info {
    flex-grow: 1;
}

.current-time {
    font-size: 3rem;
    font-weight: 600;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.current-date {
    font-size: 1.2rem;
    color: #ffffff;
    opacity: 0.9;
    margin-bottom: 15px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.timezone-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timezone-selector i {
    color: var(--accent-blue);
    font-size: 1.1rem;
}

.timezone-selector select {
    background: rgba(255, 255, 255, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-small);
    padding: 8px 12px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove iOS styling */
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><polyline points="6,9 12,15 18,9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 35px;
}

.timezone-selector select option {
    background: rgba(30, 30, 30, 0.95);
    color: #ffffff;
}

.timezone-selector select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Progress Circle */
.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--medium-gray);
    stroke-width: 2;
}

.circle {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 100, 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
}

/* Quick Add Task */
.quick-add {
    background: rgba(255, 255, 255, 0.35);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

#taskInput {
    flex-grow: 1;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-small);
    font-family: var(--font-main);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.45);
    color: #ffffff;
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove iOS styling */
    appearance: none;
}

#taskInput::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

#taskInput:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#taskTime {
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-small);
    font-family: var(--font-main);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.45);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove iOS styling */
    appearance: none;
    min-width: 120px;
}

#taskTime:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-btn {
    padding: 15px 20px;
    background: var(--gradient-main);
    border: none;
    border-radius: var(--border-radius-small);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

/* Schedule Container */
.schedule-container {
    background: rgba(255, 255, 255, 0.35);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 100px;
    backdrop-filter: blur(20px);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.schedule-header h2 {
    font-size: 1.8rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.schedule-header i {
    color: var(--primary-pink);
}

.schedule-stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stat i {
    color: var(--accent-blue);
}

/* Time Slots */
.time-slots {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.time-slot {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius-small);
    border: 2px solid rgba(255, 255, 255, 0.45);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.time-slot::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-main);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.time-slot:hover::before {
    transform: scaleY(1);
}

.time-slot.completed {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e8 100%);
    border-color: var(--success-green);
    opacity: 0.8;
}

.time-slot.completed .task-text {
    text-decoration: line-through;
    opacity: 0.7;
}

.time-label {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    min-width: 80px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.task-content {
    flex-grow: 1;
    margin: 0 20px;
}

.task-text {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.task-actions {
    display: flex;
    gap: 10px;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--medium-gray);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    background: var(--soft-white);
}

.task-checkbox:hover {
    border-color: var(--success-green);
    transform: scale(1.1);
}

.task-checkbox.checked {
    background: var(--success-green);
    border-color: var(--success-green);
}

.task-checkbox.checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--warning-orange);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.delete-btn:hover {
    background: rgba(255, 167, 38, 0.1);
    transform: scale(1.2);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--dark-gray);
    opacity: 0.6;
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary-pink);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* FAB Menu */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-main);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-medium);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-medium);
}

.main-fab {
    position: relative;
    z-index: 2;
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.fab-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.motivation-bar {
        padding: 15px 12px;
        font-size: 1rem;
        gap: 12px;
    }

    .motivation-bar i {
        font-size: 1.1rem;
}

/* Motivational Bar */
.motivation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.motivation-bar i {
    color: #ffd700;
}

/* History Modal */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.history-modal.active {
    opacity: 1;
    visibility: visible;
}

.history-content {
    background: var(--gradient-card);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.history-modal.active .history-content {
    transform: translateY(0);
}

.history-header {
    background: var(--gradient-main);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-days {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.history-day {
    background: var(--soft-white);
    border-radius: var(--border-radius-small);
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--medium-gray);
    transition: transform 0.2s ease;
}

.history-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--shadow-light);
}

.history-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--medium-gray);
}

.history-day-header h3 {
    color: var(--dark-gray);
    font-size: 1.2rem;
}

.history-progress {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-progress-circle {
    position: relative;
    width: 40px;
    height: 40px;
}

.history-progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.history-progress-circle .circle-bg {
    fill: none;
    stroke: var(--medium-gray);
    stroke-width: 2;
}

.history-progress-circle .circle {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 100, 100;
    transition: stroke-dashoffset 0.5s ease;
}

.history-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.history-stats {
    font-size: 0.9rem;
    color: var(--dark-gray);
    font-weight: 500;
}

.history-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-task {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--light-gray);
    border-radius: var(--border-radius-small);
    transition: all 0.2s ease;
}

.history-task.completed {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e8 100%);
    opacity: 0.8;
}

.history-task.completed .history-task-text {
    text-decoration: line-through;
}

.history-task-time {
    min-width: 70px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.history-task-text {
    flex-grow: 1;
    margin: 0 15px;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.history-task-status i {
    font-size: 0.9rem;
    color: var(--success-green);
}

.history-task-status .fa-circle {
    color: var(--medium-gray);
}

.empty-history {
    text-align: center;
    padding: 50px 20px;
    color: var(--dark-gray);
    opacity: 0.6;
}

.empty-history i {
    font-size: 3rem;
    color: var(--primary-pink);
    margin-bottom: 20px;
}

.empty-history h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* Delete History Modal */
.delete-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.delete-history-modal.active {
    opacity: 1;
    visibility: visible;
}

.delete-history-content {
    background: white;
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUpModal 0.3s ease;
}

.delete-history-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--light-gray);
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 20px 20px 0 0;
}

.delete-history-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-history-body {
    padding: 25px;
}

.delete-history-body p {
    margin: 0 0 20px 0;
    color: var(--dark-gray);
    font-size: 1rem;
}

.delete-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.delete-option-btn {
    padding: 15px 20px;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-main);
    font-size: 1rem;
}

.delete-option-btn:hover {
    border-color: #ff6b6b;
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.delete-option-btn i {
    font-size: 1.2rem;
    color: #ff6b6b;
    width: 20px;
}

.delete-option-btn span {
    font-weight: 500;
    color: var(--dark-gray);
    display: block;
}

.delete-option-btn small {
    color: var(--medium-gray);
    font-size: 0.85rem;
    display: block;
    margin-top: 3px;
}

.day-selection {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--light-gray);
}

.day-selection h4 {
    margin: 0 0 15px 0;
    color: var(--dark-gray);
    font-size: 1rem;
}

.selectable-days {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.selectable-day {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.selectable-day:hover {
    background: #f8f9fa;
    border-color: var(--accent-pink);
}

.selectable-day.selected {
    background: #fff5f5;
    border-color: #ff6b6b;
}

.selectable-day input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.selectable-day-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selectable-day-name {
    font-weight: 500;
    color: var(--dark-gray);
}

.selectable-day-progress {
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.delete-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-delete-btn, .cancel-delete-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.confirm-delete-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.confirm-delete-btn:hover {
    background: linear-gradient(135deg, #ee5a52, #dc554c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.cancel-delete-btn {
    background: var(--light-gray);
    color: var(--dark-gray);
}

.cancel-delete-btn:hover {
    background: var(--medium-gray);
    transform: translateY(-1px);
}

/* Default theme with fallback gradients */
:root {
    --gradient-start: #667eea;
    --gradient-middle: #764ba2;
    --gradient-end: #f093fb;
    --accent-pink: #ff6b9d;
    --accent-purple: #c44569;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #495057;
    --success-green: #28a745;
    --warning-orange: #ffc107;
    --error-red: #dc3545;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --font-main: 'Quicksand', sans-serif;
}

/* Dynamic anime theme backgrounds */
body[data-theme] {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
}

/* Dark overlay for readability */
body[data-theme]::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
    pointer-events: none;
}

/* Theme Modal */
.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.theme-modal.active {
    opacity: 1;
    visibility: visible;
}

.theme-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUpModal 0.3s ease;
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--light-gray);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle));
    color: white;
    border-radius: 20px 20px 0 0;
    flex-wrap: wrap;
    gap: 15px;
}

.theme-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme settings container */
.theme-settings {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

/* Shuffle toggle styles */
.shuffle-setting {
    display: flex;
    align-items: center;
}

.shuffle-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.shuffle-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.shuffle-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: rgba(255, 255, 255, 0.9);
}

.shuffle-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
    background: var(--accent-pink);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
}

.toggle-label i {
    font-size: 1rem;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 25px;
}

.theme-card {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.theme-card:hover {
    border-color: var(--accent-pink);
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.theme-card.active {
    border-color: var(--accent-purple);
    background: #f8f9fb;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.theme-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.loading-themes {
    text-align: center;
    padding: 40px 20px;
    color: var(--medium-gray);
    grid-column: 1 / -1;
}

.loading-themes i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent-pink);
}

.loading-themes p {
    font-size: 1rem;
    margin: 0;
}

.theme-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.theme-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--medium-gray);
    line-height: 1.4;
}

/* Welcome Modal */
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.welcome-modal.active {
    opacity: 1;
    visibility: visible;
}

.welcome-content {
    background: var(--gradient-card);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px) scale(0.9);
    transition: transform 0.5s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.welcome-modal.active .welcome-content {
    transform: translateY(0) scale(1);
}

.welcome-header {
    background: var(--gradient-main);
    color: white;
    padding: 40px 30px 30px;
    text-align: center;
}

.welcome-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.welcome-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.welcome-body {
    padding: 40px 30px;
}

.name-input-group {
    margin-bottom: 30px;
}

.name-input-group label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 12px;
}

.name-input-group input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius-small);
    font-family: var(--font-main);
    font-size: 1.1rem;
    background: var(--soft-white);
    transition: all 0.3s ease;
    -webkit-appearance: none; /* Remove iOS styling */
    appearance: none;
}

.name-input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.welcome-features {
    background: var(--light-gray);
    border-radius: var(--border-radius-small);
    padding: 25px;
    margin-bottom: 30px;
}

.welcome-features h3 {
    color: var(--dark-gray);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.welcome-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.welcome-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.welcome-features li i {
    color: var(--success-green);
    font-size: 1rem;
}

.welcome-btn {
    width: 100%;
    padding: 18px 25px;
    background: var(--gradient-main);
    border: none;
    border-radius: var(--border-radius-small);
    color: white;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.welcome-btn:active {
    transform: translateY(0);
}

/* Enhanced Touch-Friendly Styles */
.task-checkbox, .delete-btn, .fab, .add-btn, .close-btn, .welcome-btn {
    min-height: 44px; /* Apple recommended touch target size */
    min-width: 44px;
}

/* Improved Mobile Typography */
@media (max-width: 768px) {
    html {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .app-container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }

    .current-time {
        font-size: 2.2rem;
    }
    
    .current-date {
        font-size: 1rem;
    }

    .input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    #taskInput, #taskTime, .add-btn {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 16px 18px;
    }

    .schedule-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-bottom: 15px;
    }
    
    .schedule-header h2 {
        font-size: 1.5rem;
    }
    
    .schedule-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .time-slot {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 18px;
    }

    .time-label {
        min-width: auto;
        font-size: 1.1rem;
    }
    
    .task-text {
        font-size: 1rem;
        line-height: 1.4;
    }

    .task-actions {
        justify-content: center;
        gap: 15px;
    }
    
    .task-checkbox {
        width: 32px;
        height: 32px;
    }
    
    .delete-btn {
        font-size: 1.4rem;
        padding: 8px;
    }

    .fab-container {
        bottom: 100px; /* Above enlarged motivation bar */
        right: 15px;
    }
    
    .fab {
        width: 52px;
        height: 52px;
        font-size: 1.1rem;
    }
    
    .fab-menu .fab {
        width: 52px;
        height: 52px;
        font-size: 1.08rem;
    }
    
    .main-fab {
        width: 56px;
        height: 56px;
    }
    
    .motivation-bar {
        padding: 15px 12px;
        font-size: 1rem;
        gap: 12px;
    }

    .motivation-bar i {
        font-size: 1.1rem;
    }
    
    .history-content {
        width: 96%;
        max-height: 90vh;
        margin: 2vh 0;
    }
    
    .history-header {
        padding: 18px 15px;
    }
    
    .history-header h2 {
        font-size: 1.3rem;
    }
    
    .history-days {
        max-height: 65vh;
        padding: 15px;
    }
    
    .history-day {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .history-day-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .history-day-header h3 {
        font-size: 1.1rem;
    }
    
    .history-progress {
        justify-content: center;
    }
    
    .history-task {
        flex-direction: row;
        gap: 10px;
        text-align: left;
        align-items: center;
        padding: 12px 15px;
    }
    
    .history-task-time {
        min-width: 65px;
        font-size: 0.8rem;
    }
    
    .history-task-text {
        font-size: 0.9rem;
        margin: 0 10px;
    }
    
    .welcome-content {
        width: 96%;
        max-height: 92vh;
        margin: 4vh auto;
    }
    
    .welcome-header {
        padding: 25px 18px 20px;
    }
    
    .welcome-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .welcome-header p {
        font-size: 1rem;
    }
    
    .welcome-body {
        padding: 25px 18px;
    }
    
    .name-input-group input {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 16px 18px;
    }
    
    .welcome-features {
        padding: 18px;
        margin-bottom: 25px;
    }
    
    .welcome-btn {
        font-size: 1rem;
        padding: 16px 22px;
    }
}

@media (max-width: 480px) {
    .current-time {
        font-size: 1.8rem;
    }

    .schedule-header h2 {
        font-size: 1.3rem;
    }

    .task-text {
        font-size: 0.95rem;
    }

    .schedule-container {
        margin-bottom: 130px; /* More space for mobile */
        padding: 20px 15px;
    }
    
    .quick-add {
        padding: 18px 15px;
    }
    
    .header {
        padding: 18px 15px;
    }
    
    .progress-circle {
        width: 70px;
        height: 70px;
    }
    
    .progress-text {
        font-size: 0.8rem;
    }
    
    .timezone-selector select {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .time-slot {
        padding: 15px;
    }
    
    .motivation-bar {
        font-size: 0.85rem;
        padding: 12px 15px;
        line-height: 1.3;
    }
    
    .fab-container {
        bottom: 75px;
        right: 10px;
    }
    
    .fab-menu {
        bottom: 60px;
        gap: 12px;
    }
    
    .fab-menu .fab {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }
    
    .main-fab {
        width: 50px;
        height: 50px;
    }
    
    /* History modal improvements for small screens */
    .history-content {
        width: 98%;
        max-height: 93vh;
        margin: 3.5vh auto;
    }
    
    .history-header {
        padding: 15px 12px;
    }
    
    .history-header h2 {
        font-size: 1.2rem;
    }
    
    .history-days {
        padding: 12px;
    }
    
    .history-task {
        padding: 10px 12px;
    }
    
    .history-task-time {
        min-width: 60px;
        font-size: 0.75rem;
    }
    
    .history-task-text {
        font-size: 0.85rem;
        margin: 0 8px;
    }
    
    /* Welcome modal for small screens */
    .welcome-content {
        width: 98%;
        margin: 3vh auto;
    }
    
    .welcome-header {
        padding: 20px 15px 18px;
    }
    
    .welcome-header h1 {
        font-size: 1.3rem;
    }
    
    .welcome-body {
        padding: 20px 15px;
    }
    
    .welcome-features {
        padding: 15px;
    }
    
    .welcome-features h3 {
        font-size: 1rem;
    }
    
    .welcome-features li {
        font-size: 0.9rem;
    }
    
    .name-input-group label {
        font-size: 1.1rem;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.time-slot {
    animation: slideIn 0.3s ease forwards;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.add-btn:active {
    animation: bounce 0.6s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-main);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Very small screens and landscape orientation */
@media (max-width: 360px) {
    .current-time {
        font-size: 1.6rem;
    }
    
    .welcome-header h1 {
        font-size: 1.2rem;
    }
    
    .fab-container {
        bottom: 70px;
        right: 8px;
    }
    
    .main-fab {
        width: 48px;
        height: 48px;
    }
    
    .fab-menu .fab {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
}

@media screen and (orientation: landscape) and (max-height: 600px) {
    .welcome-content {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .welcome-header {
        padding: 15px 20px 12px;
    }
    
    .welcome-header h1 {
        font-size: 1.4rem;
    }
    
    .welcome-body {
        padding: 20px;
    }
    
    .history-content {
        max-height: 95vh;
    }
    
    .history-days {
        max-height: 70vh;
    }
}

/* Support for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
 

/* No themes message and related styles */
.no-themes-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--dark-gray);
    grid-column: 1 / -1;
}

.no-themes-message i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent-pink);
}

.no-themes-message h4 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: var(--dark-gray);
}

.no-themes-message p {
    margin: 0 0 20px 0;
    color: var(--medium-gray);
}

.folder-structure {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    display: inline-block;
}

.folder-structure pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--dark-gray);
    line-height: 1.4;
}

.refresh-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-medium);
}

.refresh-btn i {
    font-size: 0.9rem;
}
/* Sync Modal Styles */
.sync-modal, .import-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sync-modal.active, .import-modal.active {
    opacity: 1;
    visibility: visible;
}

.sync-content, .import-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s ease;
}

.sync-header, .import-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle));
    color: white;
    border-radius: 20px 20px 0 0;
}

.sync-header h2, .import-header h2 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-body, .import-body {
    padding: 30px 25px;
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 280px;
}

.qr-container #qrCode {
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-container #qrCode img {
    max-width: 100%;
    height: auto;
    display: block;
}

.qr-container canvas {
    max-width: 100%;
    height: auto;
}

.sync-instructions {
    background: var(--light-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sync-instructions p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: var(--dark-gray);
}

.sync-instructions ol {
    margin: 10px 0 0 20px;
    padding: 0;
}

.sync-instructions li {
    margin: 8px 0;
    color: var(--dark-gray);
}

.sync-code-display {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.sync-code-display input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--medium-gray);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: var(--light-gray);
    text-align: center;
}

.copy-code-btn {
    padding: 12px 20px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    font-weight: 500;
    white-space: nowrap;
}

.copy-code-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.import-instructions {
    background: var(--light-gray);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    color: var(--dark-gray);
}

#importDataText {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--medium-gray);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    resize: vertical;
    margin-bottom: 20px;
    background: var(--light-gray);
}

.import-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.import-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #51cf66, #37b24d);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(81, 207, 102, 0.4);
}

.cancel-btn {
    padding: 12px 24px;
    background: var(--medium-gray);
    color: var(--dark-gray);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    font-weight: 500;
}

.cancel-btn:hover {
    background: var(--dark-gray);
    color: white;
}

@media (max-width: 768px) {
    .sync-content, .import-content {
        width: 95%;
    }
    
    .sync-body, .import-body {
        padding: 20px 15px;
    }
    
    .sync-code-display {
        flex-direction: column;
    }
    
    .import-actions {
        flex-direction: column;
    }
    
    .import-btn, .cancel-btn {
        width: 100%;
        justify-content: center;
    }
}