:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(51, 65, 85, 0.8);
    
    --primary-color: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --success-color: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 16px 12px;
}

.app-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
.app-header {
    text-align: center;
    padding: 8px 0;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.search-icon {
    font-size: 14px;
    margin-right: 10px;
    opacity: 0.6;
}

#searchInput {
    width: 100%;
    height: 44px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

#searchInput::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
}

/* Progress Card */
.progress-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar-container {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #10b981 100%);
    border-radius: 5px;
    transition: width 0.4s ease-out;
    box-shadow: 0 0 12px var(--primary-glow);
}

.progress-subtext {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

/* Schedule Slots */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slot-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.slot-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slot-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.slot-morning .slot-title { color: #60a5fa; }
.slot-afternoon .slot-title { color: #fb923c; }
.slot-evening .slot-title { color: #94a3b8; }
.slot-bedtime .slot-title { color: #c084fc; }
.slot-discipline .slot-title { color: #2dd4bf; }

.slot-time {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 6px;
}

.mark-slot-btn {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.mark-slot-btn:active {
    transform: scale(0.96);
    background: rgba(99, 102, 241, 0.3);
}

/* Item Row */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.item-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.item-row.completed {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
}

.item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.item-row.completed .custom-checkbox {
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-glow);
}

.custom-checkbox::after {
    content: '✓';
    color: white;
    font-weight: 700;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition);
}

.item-row.completed .custom-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.item-details {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
}

.item-row.completed .item-name {
    color: #a7f3d0;
    text-decoration: line-through;
}

.item-dosage {
    font-size: 12px;
    color: var(--text-muted);
}

.item-schedule-desc {
    font-size: 11px;
    color: #818cf8;
    margin-top: 2px;
}

.item-time-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.15);
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Loading & Footer */
.loading-spinner {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.app-footer {
    text-align: center;
    padding: 16px 0;
    font-size: 11px;
    color: var(--text-muted);
}
