/* --- 共通: Yorozul 基本設定 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Header */
.site-header {
    width: 100%;
    background-color: #ffffff;
    color: #333333; 
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    position: sticky;
    top: 0;
    z-index: 100; 
}
.header-content {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
}
.site-header h1 {
    margin: 0;
    font-size: 1.6em;
    color: #1abc9c;
}
.site-header .subtitle {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.85em;
}

/* Container */
.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 900px;
    margin: 0 auto 40px auto;
    box-sizing: border-box;
}

/* Breadcrumbs */
.breadcrumbs {
    width: 100%;
    padding: 0 0 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eeeeee;
}
.breadcrumbs-content {
    font-size: 0.85em; 
    color: #555555;
}
.breadcrumbs a {
    color: #555555;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs a:hover {
    color: #1abc9c;
    text-decoration: underline;
}
.current-page {
    color: #95a5a6; 
}

/* --- アプリケーション固有スタイル --- */

/* Headings */
.app-wrapper h2 {
    font-size: 1.4em;
    color: #34495e;
    border-left: 5px solid #16a085;
    padding-left: 12px;
    margin: 30px 0 15px 0; 
}
.app-wrapper h2:first-child {
    margin-top: 0;
}
.app-description {
    font-size: 0.9em;
    color: #555555;
    margin-bottom: 25px;
}
.input-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eeeeee;
}
.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.time-group { flex: 0 0 120px; }
.name-group { flex: 1; }
.btn-group { flex: 0 0 100px; }

.form-group label {
    font-weight: bold;
    font-size: 0.85em;
    color: #555555;
    margin-bottom: 8px;
}
input[type="text"], input[type="time"] {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
input:focus {
    border-color: #1abc9c;
    outline: none;
}

.action-btn {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
}
.add-btn {
    background-color: #34495e;
    color: #ffffff;
}
.add-btn:hover {
    background-color: #2c3e50;
}
.error-msg {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 10px;
    margin-bottom: 0;
    min-height: 1.2em;
}

/* Event List */
.event-list-container {
    margin-top: 20px;
}
.event-list-container h3 {
    font-size: 1.1em;
    color: #2c3e50;
    margin-bottom: 10px;
}
.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #eeeeee;
    max-height: 300px;
    overflow-y: auto;
}
.event-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid #eeeeee;
    font-size: 0.95em;
}
.event-info {
    display: flex;
    gap: 15px;
    align-items: center;
}
.event-time {
    font-weight: bold;
    color: #16a085;
    font-family: monospace;
    font-size: 1.1em;
}
.event-name {
    word-break: break-all;
}
.delete-btn {
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
}
.delete-btn:hover {
    color: #e74c3c;
    text-decoration: underline;
}
.empty-state {
    color: #95a5a6;
    font-style: italic;
    padding: 15px 0;
}

/* --- Color Setting Area --- */
.color-setting-area {
    /* 【変更】登録リストとの間に余白を追加 */
    margin-top: 50px; 
}
.color-picker-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eeeeee;
}
.color-group {
    flex: 1;
    min-width: 250px;
}
.color-label {
    font-weight: bold;
    font-size: 0.95em;
    color: #555555;
    margin: 0 0 10px 0;
}
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
    gap: 8px;
}
.color-chip {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(0,0,0,0.1);
    transition: transform 0.2s, border-color 0.2s;
    box-sizing: border-box;
}
.color-chip:hover {
    transform: scale(1.1);
}
.color-chip.active {
    border-color: #333;
    transform: scale(1.15);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.divider {
    border: 0;
    border-top: 1px dashed #dddddd;
    margin: 30px 0;
}

/* Preview & Canvas Area */
.preview-area {
    background-color: #fbfbfb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eeeeee;
}
.canvas-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    overflow: hidden;
}

/* Canvas Design (Smartphone 9:16 Ratio) */
/* CSS変数で色を制御 */
.timeline-canvas {
    /* デフォルト値 */
    --preview-bg: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    --preview-text: #ffffff;
    
    width: 320px; 
    height: 569px; 
    background: var(--preview-bg);
    position: relative;
    padding: 15px 20px 20px 20px; 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: var(--preview-text);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    user-select: none; 
}

.canvas-header {
    text-align: center;
    font-size: 1.4em; 
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 5px; 
    border-bottom: 2px solid;
    border-bottom-color: currentColor; 
    opacity: 0.9; 
    padding-bottom: 5px; 
    white-space: nowrap; 
    flex-shrink: 0;
    margin-top: 0; 
}

/* Timeline Body */
.timeline-body {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 上詰め */
    gap: 12px; 
    padding: 10px 0; 
    overflow: hidden; 
}

/* Center Line */
.timeline-line {
    position: absolute;
    left: 55px; 
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: currentColor; 
    opacity: 0.5; 
    z-index: 0;
}

/* Markers */
.timeline-marker {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center; 
    z-index: 1;
}

/* 1. 時間 */
.marker-time {
    width: 45px; 
    font-size: 0.85em;
    font-weight: bold;
    text-align: right;
    padding-right: 5px; 
    box-sizing: border-box;
    font-family: monospace;
    flex-shrink: 0;
    color: inherit; 
}

/* 2. 丸印 */
.marker-dot {
    width: 8px;
    height: 8px;
    background-color: currentColor; 
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    margin-left: 6px; 
    margin-right: 6px;
}

/* 3. イベント名 */
.marker-label {
    margin-left: 2px; 
    color: inherit; 
    background: none;
    box-shadow: none;
    padding: 0;
    font-size: 0.7em; 
    font-weight: normal; 
    flex-grow: 1; 
    white-space: normal; 
    word-break: break-all;
    line-height: 1.1; 
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 20文字でも2行に収める */
    -webkit-box-orient: vertical;
}

/* Download Section */
.download-action {
    text-align: center;
    margin-top: 20px;
}
.download-btn {
    background-color: #e74c3c;
    color: #ffffff;
    max-width: 300px;
    margin: 0 auto;
    font-size: 1.1em;
}
.download-btn:hover {
    background-color: #c0392b;
}
.note {
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 10px;
}

/* Usage Caution (New) */
.usage-caution-title {
    font-size: 1.1rem;
    color: #34495e;
    border-left: 4px solid #7f8c8d;
    padding-left: 10px;
    margin-bottom: 20px;
}
.usage-caution-list {
    list-style-type: disc;
    padding-left: 20px;
    color: #555555;
    font-size: 0.9em;
    line-height: 1.8;
}
.usage-caution-list li {
    margin-bottom: 8px;
}

/* Footer (Common) */
.page-footer {
    width: 100%;
    background-color: #2c3e50;
    color: #ffffff;
    padding: 50px 0 20px 0;
    margin-top: auto;
}
.footer-content {
    width: 90%;
    max-width: 900px;
    margin: 0 auto; 
}
.footer-row {
    display: flex;
    justify-content: flex-start;
    gap: 100px; 
    margin-bottom: 50px;
}
.footer-section {
    flex: 0 0 auto;
}
.section-title {
    color: #1abc9c;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 18px;
}
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-section li {
    margin-bottom: 12px;
}
.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.footer-section a:hover {
    color: #1abc9c;
}
.copyright {
    text-align: center;
    font-size: 0.85rem;
    color: #95a5a6;
    border-top: 1px solid #34495e;
    padding-top: 25px;
    width: 100%;
}

/* Responsive */
@media (max-width: 600px) {
    .container, .header-content, .footer-content {
        width: 95%;
        padding: 20px;
    }
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .time-group, .name-group, .btn-group {
        flex: auto;
        width: 100%;
    }
    .footer-row {
        flex-direction: column;
        gap: 30px;
    }
}