/* General Body and Container */
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; /* Footerを最下部に固定するため */
    align-items: center; /* コンテンツ全体を中央寄せ */
    min-height: 100vh;
    margin: 0;
    padding: 0; 
}

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


/* Main Container Style */
.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 900px; 
    margin: 0 auto 20px auto; 
    flex-grow: 1; /* Bodyのflex設定で、HeaderとFooterの間を埋める */
}

/* Breadcrumb Style */
.breadcrumb-nav {
    font-size: 0.85em; 
    color: #7f8c8d; 
    margin-bottom: 25px; /* 下部との余白を確保 */
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0; /* 区切り線を追加してエリアを明確化 */
}
.breadcrumb-nav a {
    color: #7f8c8d; 
    text-decoration: none;
    transition: color 0.3s;
}
.breadcrumb-nav a:hover {
    color: #1abc9c;
    text-decoration: underline;
}

/* Footer Style */
.page-footer {
    width: 100%;
    background-color: #34495e; 
    color: #ddd;
    padding: 30px 0 20px 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    margin-top: auto; /* ページ下部に固定 */
}

.footer-content {
    max-width: 900px; 
    width: 95%;
    margin: 0 auto; 
    padding: 0 10px;
}

/* Footer Links Layout (Flexbox) */
.footer-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 40px; /* 横並び時の間隔 */
    margin-bottom: 20px;
    border-bottom: 1px dashed #556c80;
    padding-bottom: 20px;
}

.footer-section {
    /* 個別のボーダーは削除し、親要素でレイアウト制御 */
    margin-bottom: 0;
    padding-bottom: 0;
}

.footer-section .section-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #1abc9c; 
    margin-bottom: 10px;
}
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-section li {
    margin-bottom: 5px;
}
.footer-section li a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}
.footer-section li a:hover {
    color: #fff;
    text-decoration: underline;
}

.copyright {
    text-align: center;
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 10px;
    padding-top: 0; /* 上部の線をflexコンテナ側に移動したため調整 */
}


/* --- タイムゾーンマッチングの既存スタイル --- */

h2 { 
    color: #34495e;
    border-bottom: 2px solid #e8f8f5;
    padding-bottom: 5px;
    margin-top: 30px;
    font-size: 1.5em; 
}

/* Form Styles */
.timezone-entry {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    background-color: #f8f9fa;
}
.form-group {
    flex: 1;
    min-width: 150px;
}
.form-group label {
    display: block;
    font-weight: bold;
    color: #555555;
    margin-bottom: 5px;
    font-size: 0.9em;
    white-space: nowrap; 
}
.form-group select {
    width: 100%;
    padding: 8px 10px;
    font-size: 16px;
    border: 1px solid #dddddd;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: #ffffff;
    min-width: 180px;
}

/* Buttons and Controls */
.action-controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}
.actions {
    flex-grow: 1;
    text-align: left;
}
.calculate-action {
    flex-grow: 1;
    text-align: right;
}
.btn { 
    padding: 10px 20px; 
    font-size: 16px; 
    font-weight: bold; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    transition: background-color 0.3s; 
    min-width: 150px;
    width: 100%;
    max-width: 250px;
}
.btn-add {
    background-color: #34495e; 
    color: #fff;
}
.btn-add:hover {
    background-color: #2c3e50;
}
.btn-calculate {
    background-color: #1abc9c; 
    color: #fff;
}
.btn-calculate:hover {
    background-color: #16a085;
}
.btn-remove {
    background-color: #e74c3c;
    color: #fff;
    font-size: 0.8em;
    padding: 6px 10px;
    min-width: auto;
    width: auto;
    max-width: none;
}
.btn-remove:hover {
    background-color: #c0392b;
}

.reference-badge {
    background-color: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}

/* Result Styles */
#result-container {
    padding: 20px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background-color: #ffffff;
    margin-top: 20px;
}
.result-hidden {
    display: none;
}
#result-display h3 {
    text-align: center;
    color: #16a085;
    font-size: 1.5em;
    margin-top: 0;
}
#result-display p {
    text-align: center;
    font-weight: bold;
    font-size: 1.1em; 
    margin: 10px 0 20px;
}
#result-display ul {
    list-style: none;
    padding: 0;
    text-align: center;
    margin-bottom: 25px;
}
#result-display ul li {
    padding: 5px 0;
    border-bottom: 1px dotted #eeeeee;
}
#result-display ul li:last-child {
    border-bottom: none;
}

/* 注意書きコンテナ（結果表示直下） */
#notice-container {
    margin: 10px auto 0 auto; 
    width: 95%;
    max-width: 900px;
}
.result-notice {
    text-align: center;
    font-size: 0.8em; 
    color: #95a5a6; 
    margin: 0; 
    padding: 5px 0;
}

/* Usage Notes Section (Bottom of Card) */
.usage-notes {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
}
.usage-notes h3 {
    font-size: 1em;
    color: #34495e;
    margin-bottom: 10px;
}
.usage-notes ul {
    padding-left: 20px;
    margin: 0;
}
.usage-notes li {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-bottom: 5px;
    line-height: 1.5;
}

/* Timeline Visualisation Styles */
#visual-result h4 {
    text-align: center;
    color: #34495e;
    font-size: 1.2em;
    margin-bottom: 15px;
}
#visual-result hr {
    border: 0;
    height: 1px;
    background-color: #eeeeee;
    margin: 20px 0;
}
.timeline-row-group {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}
.timeline-label {
    width: 30%; 
    font-weight: bold;
    color: #555555;
    font-size: 0.9em;
    flex-shrink: 0;
    padding-right: 15px;
    text-align: right;
    line-height: 1.4; 
    white-space: normal; 
    overflow-wrap: break-word; 
}
.timeline-content {
    flex: 1; 
    position: relative;
    height: 35px;
}
.timeline-bar {
    position: absolute;
    top: 5px;
    left: 0;
    width: 100%;
    height: 15px;
    background-color: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
    z-index: 1;
}

/* Time Blocks */
.business-hour-block {
    position: absolute;
    height: 100%;
    background-color: #8edecb;
    z-index: 2;
}
.overlap-hour-block {
    position: absolute;
    height: 100%;
    background-color: #16a085; 
    z-index: 3;
}
.overlap-summary-bar {
    position: absolute;
    height: 100%;
    background-color: #16a085;
    z-index: 3;
}

/* Local Time Markers */
.local-timeline-markers {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    font-size: 0.75em;
    color: #7f8c8d;
    z-index: 4;
    height: 15px;
}
.local-timeline-markers span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap; 
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .header-content, #notice-container { max-width: 95%; } 
    .container { align-self: center; } 
    .timezone-entry {
        flex-direction: column;
        align-items: stretch;
    }
    .form-group {
        min-width: 100%;
    }
    .form-group:last-child {
        text-align: right;
    }
    .action-controls-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .btn {
        width: 100%;
        max-width: none;
    }
    
    /* Footer Stack on Mobile */
    .footer-links-row {
        flex-direction: column;
        gap: 15px;
    }

    .timeline-row-group {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 45px; 
    }
    .timeline-label {
        width: 100%;
        text-align: left;
        padding-right: 0;
        margin-bottom: 5px;
        white-space: normal; 
    }
    .timeline-content {
        width: 100%;
    }
}