/* 全体のリセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダースタイル */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

h1 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

#current-month-year {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 120px;
    text-align: center;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
}

/* カレンダースタイル */
.calendar-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #3498db;
    color: white;
    font-weight: bold;
    text-align: center;
}

.calendar-header div {
    padding: 15px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.calendar-header div:last-child {
    border-right: none;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(80px, auto);
}

.calendar-day {
    border: 1px solid #e0e0e0;
    padding: 10px;
    min-height: 80px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background-color: #f0f0f0;
}

.calendar-day.other-month {
    background-color: #f9f9f9;
    color: #aaa;
}

.calendar-day.today {
    background-color: #e3f2fd;
    font-weight: bold;
}

.calendar-day.has-diary {
    position: relative;
}

.calendar-day.has-diary::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background-color: #e74c3c;
    border-radius: 50%;
}

.day-number {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

/* 日記コンテナスタイル */
.diary-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.diary-container.hidden {
    display: none;
}

.diary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.diary-header h2 {
    color: #2c3e50;
}

#close-diary {
    background-color: transparent;
    color: #7f8c8d;
    font-size: 1.2rem;
    padding: 5px;
}

#close-diary:hover {
    color: #34495e;
}

.diary-section {
    margin-bottom: 25px;
}

.diary-section h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-size: 1rem;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

input[type="range"] {
    flex-grow: 1;
    max-width: 300px;
}

/* 写真アップロードスタイル */
.photo-upload-container {
    margin-bottom: 15px;
}

.photo-upload-label {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.photo-upload-label:hover {
    background-color: #2980b9;
}

input[type="file"] {
    display: none;
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.photo-item {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 4px;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

/* ボタンスタイル */
.diary-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-primary {
    background-color: #3498db;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* フッタースタイル */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #7f8c8d;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .calendar-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 5px;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .diary-container {
        padding: 15px;
    }
    
    textarea {
        min-height: 80px;
    }
    
    .photo-item {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .calendar-header div {
        padding: 10px 0;
        font-size: 0.9rem;
    }
    
    .calendar-day {
        min-height: 50px;
    }
    
    .day-number {
        font-size: 0.8rem;
    }
    
    .diary-section h3 {
        font-size: 1rem;
    }
    
    .photo-item {
        width: 100px;
        height: 100px;
    }
    
    .diary-actions {
        flex-direction: column;
    }
    
    .diary-actions button {
        width: 100%;
    }
}
