/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

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

.simple-time {
    font-size: 24px;
    font-weight: 600;
    color: #2C3E50;
}

.colon {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

    .controls {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }.controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

#clearBtn {
    background-color: #e74c3c;
    color: white;
}

#clearBtn:hover {
    background-color: #c0392b;
}

#saveBtn {
    background-color: #27ae60;
    color: white;
}

#saveBtn:hover {
    background-color: #229954;
}

#currentTimeBtn {
    background-color: #85C1E9;
    color: #2C3E50;
    border: 1px solid #AED6F1;
}

#currentTimeBtn:hover {
    background-color: #5DADE2;
    color: #1B4F72;
}

#deleteSelectedBtn {
    background-color: #F39C12;
    color: white;
}

#deleteSelectedBtn:hover {
    background-color: #E67E22;
}

#settingsBtn {
    background-color: #7F8C8D;
    color: white;
}

#settingsBtn:hover {
    background-color: #6C7B7D;
}

/* 設定モーダル */
.settings-section {
    margin-bottom: 20px;
}

.settings-section h4 {
    margin-bottom: 15px;
    color: #2C3E50;
    border-bottom: 1px solid #BDC3C7;
    padding-bottom: 5px;
}

.settings-btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

#exportJsonBtn {
    background-color: #9B59B6;
    color: white;
}

#exportJsonBtn:hover {
    background-color: #8E44AD;
}

#importBtn {
    background-color: #34495E;
    color: white;
}

#importBtn:hover {
    background-color: #2C3E50;
}

/* スケジュールテーブル */
.schedule-container {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.schedule-table th {
    background-color: #34495e;
    color: white;
    padding: 15px 8px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 今日の曜日強調 */
.schedule-table th.current-day {
    font-size: 16px; /* 通常14pxベースより少し大きく */
    background: linear-gradient(135deg, #2e4053, #34495e);
    box-shadow: inset 0 -3px 0 #5DADE2;
    letter-spacing: 1px;
}

.schedule-table th:last-child {
    border-right: none;
}

.time-header {
    width: 80px;
    background-color: #2c3e50 !important;
    position: sticky;
    left: 0;
    z-index: 15;
}

.time-cell {
    background-color: #ecf0f1;
    font-weight: 600;
    text-align: center;
    width: 80px;
    border-right: 2px solid #bdc3c7;
    padding: 8px 4px;
    font-size: 12px;
    position: sticky;
    left: 0;
    z-index: 5;
    transition: all 0.3s ease;
}

/* 現在時刻のハイライト - パステル青系統で統一 */
.time-cell.next-time {
    animation: nextTimePulse 2s infinite;
    box-shadow: 0 0 15px rgba(46, 134, 171, 0.6);
}

.time-cell.current-time {
    animation: gentlePulse 3s infinite;
    box-shadow: 0 0 12px rgba(93, 173, 226, 0.4);
}

.time-cell.near-time {
    box-shadow: 0 0 8px rgba(133, 193, 233, 0.3);
}

.time-cell.far-time {
    box-shadow: 0 0 5px rgba(174, 214, 241, 0.2);
}

@keyframes nextTimePulse {
    0% {
        box-shadow: 0 0 15px rgba(46, 134, 171, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(46, 134, 171, 0.9);
    }
    100% {
        box-shadow: 0 0 15px rgba(46, 134, 171, 0.6);
    }
}

@keyframes gentlePulse {
    0% {
        box-shadow: 0 0 12px rgba(93, 173, 226, 0.4);
    }
    50% {
        box-shadow: 0 0 18px rgba(93, 173, 226, 0.6);
    }
    100% {
        box-shadow: 0 0 12px rgba(93, 173, 226, 0.4);
    }
}

.schedule-cell {
    border: 1px solid #ddd;
    padding: 4px;
    height: 30px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    min-width: 120px;
}

.schedule-cell:hover {
    background-color: #f8f9fa;
}

.schedule-cell.selected {
    background-color: #FFE5B4 !important;
    border: 2px solid #F39C12 !important;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
}

.schedule-cell.has-event {
    color: white;
    font-weight: 500;
    font-size: 12px;
    text-align: center;
    padding: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.schedule-cell.has-event[rowspan] {
    vertical-align: middle;
    display: table-cell;
}

/* イベントの色 */
.schedule-cell.blue {
    background-color: #3498db;
}

.schedule-cell.green {
    background-color: #27ae60;
}

.schedule-cell.red {
    background-color: #e74c3c;
}

.schedule-cell.yellow {
    background-color: #f39c12;
    color: #333;
}

.schedule-cell.purple {
    background-color: #9b59b6;
}

.schedule-cell.orange {
    background-color: #e67e22;
}

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

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: #3498db;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

#saveEvent {
    background-color: #27ae60;
    color: white;
}

#saveEvent:hover {
    background-color: #229954;
}

#deleteEvent {
    background-color: #e74c3c;
    color: white;
}

#deleteEvent:hover {
    background-color: #c0392b;
}

#cancelEvent {
    background-color: #95a5a6;
    color: white;
}

#cancelEvent:hover {
    background-color: #7f8c8d;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .simple-time {
        font-size: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .schedule-container {
        overflow-x: auto;
        max-height: 75vh;
    }
    
    .schedule-table {
        min-width: 600px;
    }
    
    .schedule-cell {
        min-width: 80px;
        font-size: 11px;
    }
    
    .time-cell {
        width: 60px;
        font-size: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .controls button {
        font-size: 13px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .schedule-table th,
    .schedule-cell {
        padding: 6px 2px;
    }
    
    .schedule-cell {
        height: 25px;
        font-size: 10px;
    }
    
    .time-cell {
        font-size: 9px;
        width: 50px;
    }
}