/* =================================================================
 * Page Specific Styles for Emperor Timer (style.css)
 * ================================================================= */

/* ... (既存のスタイルはそのまま維持) ... */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1090;
    backdrop-filter: blur(3px);
}

.tool-container {
    min-height: 500px;
}

.timer-display-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    height: 300px;
}

.timer-input-display {
    font-family: 'DSEG7 Classic', 'Roboto', monospace;
    font-weight: 400;
    font-size: 9rem;
    color: var(--bs-heading-color);
    background-color: transparent;
    border: none;
    outline: none;
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 0;
    letter-spacing: 5px;
}

.timer-input-display:disabled {
    color: var(--bs-primary);
}

.timer-controls-row {
    max-width: 900px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.timer-slider-wrapper .d-flex {
    gap: 1rem !important;
}

.timer-slider-wrapper .form-range {
    flex-grow: 1;
}

.timer-slider-wrapper .form-control {
    flex-shrink: 0;
}

#timer-presets-default {
    padding-top: 0;
    height: 100%;
}

.timer-preset-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.stopwatch-display-wrapper {
    padding: 20px 0;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    border: none;
}

.stopwatch-display {
    font-family: 'DSEG7 Classic', 'Roboto', monospace;
    font-weight: 400;
    font-size: 7rem;
    color: var(--bs-heading-color);
    text-align: center;
    letter-spacing: 5px;
}

.stopwatch-millis {
    font-size: 0.7em;
    color: var(--bs-secondary-color);
}

.lap-list-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

.lap-list-wrapper table {
    font-weight: 400;
}

.lap-list-wrapper thead.sticky-top {
    top: 0;
}

.analog-clock-wrapper {
    padding: 20px 0;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.analog-clock {
    width: 375px;
    height: 375px;
    border: 5px solid var(--bs-heading-color);
    border-radius: 50%;
    position: relative;
    background-color: var(--bs-body-bg);
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.hour-hand {
    width: 6px;
    height: 120px;
    background-color: var(--bs-heading-color);
    margin-left: 0;
    transform: translateX(-50%);
    z-index: 10;
}

.minute-hand {
    width: 6px;
    height: 150px;
    background-color: var(--bs-heading-color);
    margin-left: 0;
    transform: translateX(-50%);
    z-index: 11;
}

.second-hand {
    width: 2px;
    height: 160px;
    background-color: var(--bs-danger);
    margin-left: 0;
    transform: translateX(-50%);
    z-index: 12;
}

.center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background-color: var(--bs-danger);
    border: 2px solid var(--bs-body-bg);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 13;
}

.marker {
    position: absolute;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--bs-heading-color);
}

.marker-12 {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.marker-6 {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.marker-3 {
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

.marker-9 {
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
}

.digital-date-display {
    color: var(--bs-secondary-color);
    font-weight: 300;
    letter-spacing: 1px;
    width: 100%;
    text-align: center;
    justify-content: center;
    align-items: center;
}

@media (max-width: 767px) {
    .timer-input-display {
        font-size: 6rem;
        max-width: 100%;
        letter-spacing: 3px;
    }

    .stopwatch-display {
        font-size: 5rem;
        letter-spacing: 3px;
    }

    .timer-display-wrapper {
        height: 250px;
    }

    .analog-clock-wrapper,
    .stopwatch-display-wrapper {
        height: 250px;
    }

    .analog-clock {
        width: 300px;
        height: 300px;
    }

    .timer-controls-row>div {
        max-width: 100%;
        flex-basis: 100%;
    }

    .timer-controls-row .col-md-6:nth-child(1) {
        order: -2;
    }

    .timer-controls-row .col-md-6:nth-child(2) {
        order: -1;
    }

    #timer-presets-default {
        padding-top: 1rem;
        justify-content: center !important;
    }
}

@media (max-width: 576px) {
    .timer-input-display {
        font-size: 4rem;
        letter-spacing: 2px;
    }

    .stopwatch-display {
        font-size: 3rem;
        letter-spacing: 2px;
    }

    #timer-panel .btn-lg,
    #stopwatch-panel .btn-lg {
        display: block;
        width: 100% !important;
        margin: 0.5rem 0 !important;
    }

    #timer-alarm-stop-btn {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.tool-container:fullscreen {
    background-color: var(--bs-card-bg) !important;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.tool-container:fullscreen .card-body {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tool-container:fullscreen .tab-content {
    flex-grow: 1;
    height: 100%;
}

.tool-container:fullscreen .card-header,
.tool-container:fullscreen .card-footer {
    display: none;
}

.tool-container:fullscreen .tab-pane:not(.active) {
    display: none !important;
}

.tool-container:fullscreen .tab-pane.active {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* フルスクリーン時の非表示ルール（進行タイマーは例外） */
.tool-container:fullscreen .tab-pane.active:not(#section-panel)>*:not(.timer-display-wrapper):not(.stopwatch-display-wrapper):not(.analog-clock-wrapper):not(.d-flex):not(.progress) {
    display: none !important;
}

.tool-container:fullscreen .progress {
    display: block !important;
    flex-grow: 0;
    flex-shrink: 0;
    width: 90%;
    max-width: 1000px;
    margin: 2vmin auto !important;
    padding: 0;
    height: 2vmin !important;
}

.tool-container:fullscreen #timer-progress-bar {
    height: 100%;
}

.tool-container:fullscreen .timer-display-wrapper,
.tool-container:fullscreen .stopwatch-display-wrapper,
.tool-container:fullscreen .analog-clock-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.tool-container:fullscreen .tab-pane.active>.d-flex {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-grow: 0;
    flex-shrink: 0;
    width: 100%;
    padding: 2rem 0 1rem 0;
}

.tool-container:fullscreen #stopwatch-panel .d-flex:not(.my-3) {
    display: none !important;
}

.tool-container:fullscreen #clock-panel .digital-date-display {
    display: flex !important;
    flex-grow: 0;
    flex-shrink: 0;
    width: 100%;
    padding: 0.5rem 0 0.5rem 0;
    justify-content: center;
    text-align: center;
}

.tool-container:fullscreen .btn-lg {
    min-height: 50px;
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
    height: auto !important;
    min-width: 120px;
}

.tool-container:fullscreen #timer-alarm-stop-btn {
    min-height: 50px;
    width: auto !important;
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
}

.tool-container:fullscreen .timer-input-display {
    font-size: 24vmin;
    max-width: 95%;
    letter-spacing: 5px;
}

.tool-container:fullscreen .stopwatch-display {
    font-size: 20vmin;
    letter-spacing: 5px;
}

.tool-container:fullscreen .analog-clock {
    width: 55vmin;
    height: 55vmin;
    border-width: 1.5vmin;
}

.tool-container:fullscreen .stopwatch-millis {
    font-size: 0.7em;
}

.tool-container:fullscreen .digital-date-display {
    font-size: 4vmin;
}

.tool-container:fullscreen .hand {
    border-top-left-radius: 2vmin;
    border-top-right-radius: 2vmin;
}

.tool-container:fullscreen .hour-hand {
    width: 1.5vmin;
    height: 30%;
    margin-left: -0.75vmin;
}

.tool-container:fullscreen .minute-hand {
    width: 1.5vmin;
    height: 40%;
    margin-left: -0.75vmin;
}

.tool-container:fullscreen .second-hand {
    width: 0.5vmin;
    height: 45%;
    margin-left: -0.25vmin;
}

.tool-container:fullscreen .center-dot {
    width: 3vmin;
    height: 3vmin;
    border-width: 0.5vmin;
}

.tool-container:fullscreen .marker {
    font-size: 6vmin;
}

.tool-container:fullscreen .marker-12 {
    top: 0vmin;
}

.tool-container:fullscreen .marker-6 {
    bottom: 0vmin;
}

.tool-container:fullscreen .marker-3 {
    right: 2vmin;
}

.tool-container:fullscreen .marker-9 {
    left: 2vmin;
}

.analog-clock.clock-classic {
    background-color: var(--bs-white);
    border: 3px solid var(--bs-dark);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.analog-clock.clock-classic .marker {
    font-weight: 400;
    color: var(--bs-dark);
}

.analog-clock.clock-classic .hour-hand,
.analog-clock.clock-classic .minute-hand {
    background-color: var(--bs-dark);
}

.analog-clock.clock-classic .center-dot {
    background-color: var(--bs-warning);
    border-color: var(--bs-dark);
}

/* --- Section Timer Styles --- */
#section-panel .timer-input-display {
    font-family: 'DSEG7 Classic', 'Roboto', monospace;
    font-weight: 400;
    font-size: 8rem;
    color: var(--bs-heading-color);
    background-color: transparent;
    border: none;
    outline: none;
    text-align: center;
    width: 100%;
    padding: 0;
    letter-spacing: 5px;
}

#section-panel .timer-input-display.text-danger {
    color: var(--bs-danger) !important;
}

#section-current-title.text-danger {
    color: var(--bs-danger) !important;
}

#section-list-body tr.table-active {
    background-color: var(--bs-primary-bg-subtle);
    font-weight: bold;
}

/* 進行タイマーのフルスクリーン調整 */
/* タイトルを表示 */
.tool-container:fullscreen #section-panel.active>.text-center.mb-2 {
    display: block !important;
    font-size: 2rem;
    padding-top: 1rem;
    flex-grow: 0;
}

/* リストも表示させたい場合（今回は隠さずに表示する方針） */
.tool-container:fullscreen #section-panel.active>.row {
    display: flex !important;
    flex-grow: 1;
    overflow-y: auto;
    align-items: flex-start;
}

/* 設定系は隠す */
.tool-container:fullscreen #section-panel.active .card.bg-light,
.tool-container:fullscreen #section-panel.active hr.my-4 {
    display: none !important;
}

.tool-container:fullscreen #section-display {
    font-size: 20vmin;
}