/* ========================================
   リセット & 基本設定
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 50%, #c8e6c9 100%);
    min-height: 100vh;
    color: #2e7d32;
    padding: 10px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   ヘッダー（コンパクト）
======================================== */
header {
    text-align: center;
    padding: 15px 0;
    margin-bottom: 15px;
}

header h1 {
    font-size: 28px;
    color: #2e7d32;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #4caf50;
    font-weight: 500;
}

/* ========================================
   メインコンテンツエリア（画面上部）
======================================== */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.2);
}

/* ========================================
   テーマ選定セクション（コンパクト）
======================================== */
.theme-selection-section {
    margin-bottom: 20px;
}

.mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #4caf50;
    background: white;
    color: #4caf50;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: #e8f5e9;
}

.mode-btn.active {
    background: #4caf50;
    color: white;
}

.mode-content {
    display: none;
    text-align: center;
}

.mode-content.active {
    display: block;
}

.main-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.manual-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#manualThemeInput {
    flex: 1;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid #4caf50;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#manualThemeInput:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* ========================================
   テーマ表示 ＆ タイマー（横並び）
======================================== */
.theme-timer-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* テーマ表示エリア */
.theme-display {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 15px;
    padding: 20px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-placeholder {
    text-align: center;
    color: #81c784;
}

.theme-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.theme-content {
    text-align: center;
    width: 100%;
}

.theme-category {
    display: inline-block;
    padding: 6px 15px;
    background: #4caf50;
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.theme-text {
    font-size: 22px;
    font-weight: 600;
    color: #2e7d32;
    line-height: 1.5;
    margin-bottom: 20px;
}

.timer-start-btn {
    padding: 12px 25px;
    background: #66bb6a;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-start-btn:hover {
    background: #4caf50;
    transform: scale(1.05);
}

/* タイマー表示エリア */
.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.timer-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

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

.timer-bg {
    fill: none;
    stroke: #e8f5e9;
    stroke-width: 12;
}

.timer-progress {
    fill: none;
    stroke: #4caf50;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke 0.3s ease, stroke-dashoffset 0.5s linear;
}

.timer-progress.warning {
    stroke: #ff9800;
}

.timer-progress.danger {
    stroke: #f44336;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    font-size: 48px;
    font-weight: 700;
    color: #2e7d32;
}

.timer-colon {
    margin: 0 5px;
}

.timer-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #4caf50;
    background: white;
    color: #4caf50;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover:not(:disabled) {
    background: #4caf50;
    color: white;
    transform: scale(1.1);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========================================
   統計情報（コンパクト）
======================================== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.1);
}

.stat-card i {
    font-size: 24px;
    color: #4caf50;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #66bb6a;
    font-weight: 500;
}

/* ========================================
   履歴セクション（コンパクト）
======================================== */
.history-section {
    background: white;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.1);
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f5e9;
}

.history-header h3 {
    font-size: 16px;
    color: #2e7d32;
}

.history-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.history-filter {
    padding: 6px 12px;
    border: 2px solid #4caf50;
    border-radius: 20px;
    background: white;
    color: #2e7d32;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.clear-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #f44336;
    background: white;
    color: #f44336;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #f44336;
    color: white;
}

.history-list {
    flex: 1;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    padding: 30px;
    color: #81c784;
}

.history-empty i {
    font-size: 40px;
    margin-bottom: 10px;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #f1f8e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.history-item:hover {
    background: #f1f8e9;
}

.history-item-left {
    flex: 1;
}

.history-date {
    font-size: 11px;
    color: #81c784;
    margin-bottom: 3px;
}

.history-theme {
    font-size: 13px;
    color: #2e7d32;
    font-weight: 500;
}

.history-category {
    display: inline-block;
    padding: 3px 8px;
    background: #e8f5e9;
    color: #4caf50;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

/* ========================================
   モーダル
======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.modal-content h2 {
    color: #2e7d32;
    margin-bottom: 15px;
}

.modal-content p {
    color: #66bb6a;
    margin-bottom: 25px;
}

.modal-btn {
    padding: 12px 30px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: #2e7d32;
    transform: scale(1.05);
}

/* ========================================
   レスポンシブ対応
======================================== */
@media (max-width: 768px) {
    header h1 {
        font-size: 22px;
    }

    .theme-timer-section {
        grid-template-columns: 1fr;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .timer-circle {
        width: 180px;
        height: 180px;
    }

    .timer-text {
        font-size: 40px;
    }

    .theme-text {
        font-size: 18px;
    }

    .manual-input-group {
        flex-direction: column;
    }

    #manualThemeInput {
        max-width: 100%;
        width: 100%;
    }
}

/* スクロールバーのスタイリング */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f8e9;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #4caf50;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #2e7d32;
}
