/* ==========================================
   Planter - メインスタイルシート
   テーマ: ナチュラル系（グリーン、ベージュ、ホワイト）
   ========================================== */

/* Google Fonts - 丸ゴシック系 */
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@300;400;500;700&display=swap');

/* ==================== CSS Variables ==================== */
:root {
    --primary: #4CAF50;
    --primary-light: #81C784;
    --primary-dark: #388E3C;
    --primary-bg: #E8F5E9;
    --secondary: #8D6E63;
    --secondary-light: #BCAAA4;
    --accent: #FFB74D;
    --accent-light: #FFE0B2;
    --bg: #FAFAF5;
    --bg-card: #FFFFFF;
    --bg-warm: #FFF8E1;
    --text: #3E2723;
    --text-light: #795548;
    --text-muted: #A1887F;
    --border: #E0D8D0;
    --border-light: #F0EBE3;
    --danger: #EF5350;
    --danger-light: #FFCDD2;
    --shadow: 0 2px 8px rgba(62, 39, 35, 0.08);
    --shadow-lg: 0 4px 16px rgba(62, 39, 35, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic Pro', 'BIZ UDGothic', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

/* ==================== App Header ==================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(56, 142, 60, 0.3);
}

.app-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header h1 .icon {
    font-size: 1.4rem;
}

.header-subtitle {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.header-btn:hover, .header-btn:active {
    background: rgba(255,255,255,0.35);
}

/* ==================== Bottom Navigation ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 calc(6px + var(--safe-bottom));
    box-shadow: 0 -2px 12px rgba(62, 39, 35, 0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    min-width: 56px;
}

.nav-item .nav-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-item:hover {
    color: var(--primary-light);
}

/* ==================== Screen Container ==================== */
.screen {
    display: none;
    padding: 16px;
    max-width: 480px;
    margin: 0 auto;
    animation: fadeIn 0.25s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== Calendar Screen ==================== */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-nav .month-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.calendar-nav button {
    background: var(--primary-bg);
    border: none;
    color: var(--primary-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.calendar-nav button:hover {
    background: var(--primary-light);
    color: white;
}

.today-btn {
    font-size: 0.75rem !important;
    width: auto !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 16px;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 0;
}

.calendar-weekday:first-child { color: var(--danger); }
.calendar-weekday:last-child { color: #1976D2; }

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-size: 0.85rem;
    gap: 2px;
    border: 2px solid transparent;
}

.calendar-day:hover {
    background: var(--primary-bg);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    border-color: var(--primary);
    font-weight: 700;
}

.calendar-day.selected {
    background: var(--primary);
    color: white;
}

.calendar-day.selected .day-study-time {
    color: rgba(255,255,255,0.85);
}

.calendar-day .day-number {
    font-size: 0.85rem;
    line-height: 1;
}

.calendar-day.sunday .day-number { color: var(--danger); }
.calendar-day.saturday .day-number { color: #1976D2; }
.calendar-day.selected .day-number { color: white; }

.day-indicators {
    display: flex;
    gap: 2px;
    min-height: 6px;
}

.day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.day-dot.plan { background: var(--accent); }
.day-dot.record { background: var(--primary); }

.day-study-time {
    font-size: 0.5rem;
    color: var(--primary-dark);
    font-weight: 500;
    line-height: 1;
}

/* ==================== Day Detail Screen ==================== */
.day-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-btn {
    background: var(--primary-bg);
    border: none;
    color: var(--primary-dark);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--primary-light);
    color: white;
}

.day-detail-date {
    font-size: 1.1rem;
    font-weight: 700;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title .icon {
    font-size: 1rem;
}

/* Plan & Record Cards */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.plan-card, .record-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.plan-card:hover, .record-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-color-bar {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-subject {
    font-size: 0.9rem;
    font-weight: 500;
}

.card-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 6px;
}

.card-action-btn {
    background: var(--primary-bg);
    border: none;
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.card-action-btn:hover {
    background: var(--primary);
    color: white;
}

.card-action-btn.delete {
    color: var(--danger);
    background: var(--danger-light);
}

.card-action-btn.delete:hover {
    background: var(--danger);
    color: white;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.empty-message .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

/* Add Plan Button */
.add-plan-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-bg);
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius);
    color: var(--primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.add-plan-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Quick Timer Button */
.quick-timer-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.quick-timer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

/* ==================== Modal / Add Plan Form ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(62, 39, 35, 0.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 480px;
    padding: 24px 20px calc(24px + var(--safe-bottom));
    animation: slideUp 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23795548' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

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

.btn-secondary {
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* ==================== Timer Screen ==================== */
.timer-screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.timer-subject {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 8px;
}

.timer-subject-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--primary-bg);
}

.timer-subject-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.timer-display {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

.timer-target {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.timer-progress {
    width: 200px;
    height: 200px;
    position: relative;
    margin: 16px auto 32px;
}

.timer-progress svg {
    transform: rotate(-90deg);
}

.timer-progress-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 8;
}

.timer-progress-bar {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-controls {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.timer-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-btn-start {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
}

.timer-btn-start:hover {
    transform: scale(1.05);
}

.timer-btn-pause {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 183, 77, 0.4);
}

.timer-btn-stop {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 16px rgba(239, 83, 80, 0.3);
}

.timer-btn-stop:hover {
    transform: scale(1.05);
}

/* Timer Select Subject */
.timer-select-wrap {
    text-align: center;
}

.timer-select-wrap h3 {
    margin-bottom: 16px;
    font-weight: 500;
    color: var(--text-light);
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.subject-chip {
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.subject-chip:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.subject-chip .chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ==================== Stats Screen ==================== */
.stats-tabs {
    display: flex;
    gap: 4px;
    background: var(--border-light);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
}

.stats-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.stats-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.stats-card h3 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-container {
    height: 200px;
    position: relative;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-rank {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 20px;
}

.stat-subject-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stat-subject-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-row-right {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-bar-wrap {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.stat-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.achievement-rate {
    text-align: center;
    padding: 12px;
}

.achievement-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    position: relative;
}

.achievement-circle svg {
    transform: rotate(-90deg);
}

.achievement-circle-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 10;
}

.achievement-circle-bar {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.achievement-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* ==================== Settings Screen ==================== */
.settings-section {
    margin-bottom: 24px;
}

.settings-section-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-left: 4px;
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.settings-item {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: var(--bg);
}

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

.settings-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.settings-item-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.settings-item-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.settings-item-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Subject List in Settings */
.subject-list-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.subject-list-item:last-child {
    border-bottom: none;
}

.subject-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.subject-list-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.subject-list-actions {
    display: flex;
    gap: 6px;
}

.subject-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: var(--transition);
}

.subject-action-btn:hover {
    color: var(--primary);
}

.subject-action-btn.delete:hover {
    color: var(--danger);
}

/* Color Picker */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text);
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--text);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== Utilities ==================== */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ==================== Responsive ==================== */
@media (min-width: 480px) {
    .screen {
        padding: 20px;
    }
    
    .timer-display {
        font-size: 4.5rem;
    }
}

/* ==================== Plant Decoration ==================== */
.plant-deco {
    display: inline-block;
    animation: sway 3s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* ==================== Theme Presets ==================== */
/* Green (default) は :root で定義済み */

[data-theme="sakura"] {
    --primary: #E91E63;
    --primary-light: #F48FB1;
    --primary-dark: #C2185B;
    --primary-bg: #FCE4EC;
    --accent: #FF8A65;
    --accent-light: #FFCCBC;
    --bg: #FFF8F6;
    --bg-card: #FFFFFF;
    --text: #3E2723;
    --text-light: #6D4C41;
    --text-muted: #BCAAA4;
    --border: #F0D8D0;
    --border-light: #FBF0EC;
}

[data-theme="ocean"] {
    --primary: #1976D2;
    --primary-light: #64B5F6;
    --primary-dark: #0D47A1;
    --primary-bg: #E3F2FD;
    --accent: #26C6DA;
    --accent-light: #B2EBF2;
    --bg: #F5F9FC;
    --bg-card: #FFFFFF;
    --text: #1A237E;
    --text-light: #3949AB;
    --text-muted: #9FA8DA;
    --border: #C5CAE9;
    --border-light: #E8EAF6;
}

[data-theme="sunset"] {
    --primary: #FF6F00;
    --primary-light: #FFB74D;
    --primary-dark: #E65100;
    --primary-bg: #FFF3E0;
    --accent: #FF7043;
    --accent-light: #FFCCBC;
    --bg: #FFFAF5;
    --bg-card: #FFFFFF;
    --text: #3E2723;
    --text-light: #6D4C41;
    --text-muted: #BCAAA4;
    --border: #F0DDD0;
    --border-light: #FFF0E8;
}

[data-theme="lavender"] {
    --primary: #7B1FA2;
    --primary-light: #BA68C8;
    --primary-dark: #4A148C;
    --primary-bg: #F3E5F5;
    --accent: #FF80AB;
    --accent-light: #FCE4EC;
    --bg: #FAF5FC;
    --bg-card: #FFFFFF;
    --text: #311B92;
    --text-light: #5E35B1;
    --text-muted: #B39DDB;
    --border: #D1C4E9;
    --border-light: #EDE7F6;
}

[data-theme="mocha"] {
    --primary: #6D4C41;
    --primary-light: #A1887F;
    --primary-dark: #4E342E;
    --primary-bg: #EFEBE9;
    --accent: #FFB300;
    --accent-light: #FFF8E1;
    --bg: #FAF7F5;
    --bg-card: #FFFFFF;
    --text: #3E2723;
    --text-light: #5D4037;
    --text-muted: #BCAAA4;
    --border: #D7CCC8;
    --border-light: #EFEBE9;
}

[data-theme="night"] {
    --primary: #66BB6A;
    --primary-light: #A5D6A7;
    --primary-dark: #43A047;
    --primary-bg: #263238;
    --accent: #FFD54F;
    --accent-light: #37474F;
    --bg: #1A1A2E;
    --bg-card: #222244;
    --text: #E8E8E8;
    --text-light: #B0BEC5;
    --text-muted: #78909C;
    --border: #37474F;
    --border-light: #2C2C4A;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ==================== Floating Save Button ==================== */
.floating-save-btn {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    right: 16px;
    z-index: 90;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), #FF8F00);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 143, 0, 0.4);
    transition: all 0.25s ease;
    animation: floatPulse 3s ease-in-out infinite;
}

.floating-save-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(255, 143, 0, 0.5);
}

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

.floating-save-btn .save-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg);
    display: none;
}

.floating-save-btn .save-badge.show {
    display: block;
    animation: badgePop 0.3s ease;
}

@keyframes floatPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(255, 143, 0, 0.35); }
    50% { box-shadow: 0 4px 20px rgba(255, 143, 0, 0.55); }
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ==================== Tooltip / Bubble Tutorial ==================== */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-overlay.active {
    display: block;
}

.tutorial-bubble {
    position: fixed;
    z-index: 401;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    display: none;
    animation: bubbleIn 0.4s ease;
}

.tutorial-bubble.active {
    display: block;
}

@keyframes bubbleIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.tutorial-bubble::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--bg-card);
    transform: rotate(45deg);
}

.tutorial-bubble.arrow-bottom::after {
    bottom: -7px;
    right: 32px;
}

.tutorial-bubble.arrow-top::after {
    top: -7px;
    left: 32px;
}

.tutorial-bubble.arrow-bottom-right::after {
    bottom: -7px;
    right: 28px;
}

.tutorial-mascot {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.tutorial-text {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
}

.tutorial-text strong {
    color: var(--primary);
}

.tutorial-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-step {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.tutorial-next-btn {
    padding: 6px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tutorial-next-btn:hover {
    background: var(--primary-dark);
}

.tutorial-skip {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

/* ==================== Theme Selector in Settings ==================== */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px 16px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: var(--radius);
    border: 2.5px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.theme-option:hover {
    border-color: var(--primary-light);
}

.theme-option.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(0,0,0,0.08);
}

.theme-preview-half {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
}

.theme-preview-half:first-child {
    left: 0;
}

.theme-preview-half:last-child {
    right: 0;
}

.theme-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text);
}

/* ==================== Data Info Banner ==================== */
.data-info-banner {
    background: linear-gradient(135deg, var(--accent-light), var(--primary-bg));
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.data-info-banner h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.data-info-banner p {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 6px;
}

.data-info-banner .info-highlight {
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    color: var(--primary-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
