/* 生活サポートアプリ スタイルシート */

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

body {
    font-family: 'Hiragino Sans', 'ヒラギノ角ゴシック', 'Yu Gothic', '游ゴシック', Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e8 100%);
    min-height: 100vh;
}

/* アプリコンテナ */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ローディング画面 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e8 100%);
}

.loading-content {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.loading-content h2 {
    font-size: 2.5rem;
    color: #2196f3;
    margin-bottom: 20px;
}

.loading-content p {
    font-size: 1.5rem;
    color: #666;
}

/* ナビゲーションバー */
.navbar {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.nav-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn.active {
    background: #2196f3;
    color: white;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.nav-icon {
    font-size: 1.5rem;
}

/* メインコンテンツ */
.main-content {
    background: #f5f5f5;
    border-radius: 20px;
    padding: 30px;
    min-height: 70vh;
}

/* ビュー管理 */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* ホーム画面 */
.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.weather-info {
    text-align: left;
}

.current-date {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 8px;
}

.weather-display {
    font-size: 1.4rem;
    color: #2196f3;
    font-weight: bold;
}

.welcome-message {
    text-align: right;
}

.app-title {
    font-size: 2.5rem;
    color: #2196f3;
    margin-bottom: 10px;
    font-weight: bold;
}

.welcome-text {
    font-size: 1.3rem;
    color: #666;
}

.home-buttons {
    display: grid;
    gap: 20px;
}

.home-btn {
    background: white;
    border: none;
    border-radius: 15px;
    padding: 30px;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    color: white;
}

.home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.home-btn.green {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.home-btn.blue {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
}

.home-btn.purple {
    background: linear-gradient(135deg, #9c27b0, #ba68c8);
}

.home-btn.orange {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.btn-icon {
    font-size: 2.5rem;
}

.btn-text {
    font-size: 1.5rem;
}

/* ビューヘッダー */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.view-header h2 {
    font-size: 2rem;
    color: #333;
}

.voice-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-btn:hover {
    background: #d0d0d0;
    transform: scale(1.1);
}

/* フォーム */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #2196f3;
}

.form-textarea {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-textarea:focus {
    outline: none;
    border-color: #2196f3;
}

/* 写真選択グリッド */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.photo-item {
    background: #f0f0f0;
    border: 3px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    font-size: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-item:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.photo-item.selected {
    border-color: #4caf50;
    background: #e8f5e9;
}

/* 気分選択グリッド */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.mood-item {
    background: #f0f0f0;
    border: 3px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mood-item:hover {
    background: #e0e0e0;
    transform: scale(1.02);
}

.mood-item.selected {
    border-color: #4caf50;
    background: #e8f5e9;
}

.mood-emoji {
    font-size: 2.5rem;
}

.mood-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* アイコン選択グリッド */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.icon-item {
    background: #f0f0f0;
    border: 3px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.icon-item:hover {
    background: #e0e0e0;
    transform: scale(1.02);
}

.icon-item.selected {
    border-color: #2196f3;
    background: #e3f2fd;
}

.icon-item.none {
    font-size: 1.1rem;
    font-weight: bold;
    color: #666;
}

.icon-emoji {
    font-size: 2rem;
}

.icon-text {
    font-size: 0.9rem;
    color: #666;
}

/* アイコンテキストを非表示（「なし」以外） */
.icon-item:not(.none) .icon-text {
    display: none;
}

/* 写真入力セクション */
.photo-input-section {
    margin-bottom: 15px;
}

.photo-file-input {
    display: none;
}

.photo-input-btn {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 10px;
}

.photo-input-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.photo-preview {
    display: none;
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 10px;
    background: #f9f9f9;
    text-align: center;
    margin-bottom: 10px;
}

.photo-preview.show {
    display: block;
}

.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.photo-preview-remove {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.photo-divider {
    text-align: center;
    color: #666;
    font-size: 1rem;
    margin: 15px 0 10px 0;
    position: relative;
}

.photo-divider::before,
.photo-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #ddd;
}

.photo-divider::before {
    left: 0;
}

.photo-divider::after {
    right: 0;
}

/* 送信ボタン */
.submit-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.submit-btn.green {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.submit-btn.blue {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
}

/* カレンダー */
.calendar-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.calendar-type-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-type-btn.active {
    background: #2196f3;
    color: white;
}

.calendar-mode-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.mode-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calendar-navigation .nav-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-navigation .nav-btn:hover {
    background: #e0e0e0;
}

.current-date-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.calendar-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* 履歴セクション */
.history-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.history-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    border-left: 4px solid #ddd;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.history-item.diary {
    border-left-color: #4caf50;
}

.history-item.schedule {
    border-left-color: #2196f3;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: bold;
}

.history-content {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
}

.history-timestamp {
    font-size: 0.9rem;
    color: #666;
}

/* 今後の予定セクション */
.upcoming-schedules {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-top: 25px;
}

.upcoming-schedules h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .weather-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .welcome-message {
        text-align: center;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .mood-grid {
        grid-template-columns: 1fr;
    }
    
    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .photo-preview img {
        max-width: 150px;
        max-height: 150px;
    }
    
    .calendar-type-selector {
        flex-direction: column;
    }
    
    .week-view {
        grid-template-columns: 1fr;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view.active {
    animation: fadeIn 0.5s ease;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 週表示スタイル */
.week-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.week-day-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background: white;
    text-align: center;
    min-height: 120px;
}

.week-day-header {
    font-weight: bold;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.week-day-content {
    /* display: flex; */
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.week-day-content.empty {
    color: #999;
    font-size: 0.8rem;
}

.week-diary-text {
    font-size: 0.8rem;
    color: #555;
    text-align: center;
    line-height: 1.2;
}

/* 予定週表示スタイル */
.week-day-content.schedule-content {
    gap: 3px;
}

.week-schedule-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    padding: 2px;
    background: #f0f8ff;
    border-radius: 3px;
    margin: 1px 0;
}

.week-schedule-time {
    font-weight: bold;
    color: #2196f3;
    font-size: 0.6rem;
    min-width: 30px;
}

.week-schedule-text {
    color: #333;
    font-size: 0.6rem;
    line-height: 1.1;
    flex: 1;
}

.week-more-count {
    font-size: 0.6rem;
    color: #666;
    text-align: center;
    font-style: italic;
    margin-top: 2px;
}

/* モバイルでの週表示調整 */
@media (max-width: 768px) {
    .week-view {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .week-day-item {
        min-height: auto;
        padding: 8px;
    }
    
    .week-day-content {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .week-diary-text {
        font-size: 0.9rem;
        text-align: left;
        flex: 1;
        margin-left: 10px;
    }
    
    .week-day-content.schedule-content {
        align-items: flex-start;
    }
    
    .week-schedule-item {
        font-size: 0.8rem;
        padding: 3px;
        margin: 2px 0;
    }
    
    .week-schedule-time {
        font-size: 0.7rem;
        min-width: 35px;
    }
    
    .week-schedule-text {
        font-size: 0.7rem;
    }
}