/* 全幅対応モーダル時計CSS */

.world-clock {
    display: flex;
    flex-flow: wrap;
    gap: 10px;
}

/* 通常の時計表示のリセット・修正 */
.world-cloud .jcgmt-container {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 通常の時計のサイズを固定 */
.world-clock .jcgmt-clockHolder {
    width: 120px !important;
    height: 120px !important;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.world-clock .jcgmt-clock {
    width: 100% !important;
    height: auto !important;
    max-width: 120px !important;
}

/* 通常の針のサイズを調整 */
.world-clock .jcgmt-sec,
.world-clock .jcgmt-min,
.world-clock .jcgmt-hour {
    width: 2px !important;
    height: 100%;
    position: absolute;
    left: 50%;
    top: 0;
    transform-origin: 50% 50%;
    margin-left: -1px;
}

/* ホバー効果 */
.world-clock .jcgmt-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.world-clock .jcgmt-container:hover .jcgmt-lbl {
    color: white;
}

.world-clock .jcgmt-container:hover .jcgmt-digital {
    color: white;
}

.world-clock .jcgmt-container:hover .jcgmt-date {
    color: rgba(255, 255, 255, 0.9);
}

/* モーダルのベース */
.world-clock-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in-out;
}

.world-clock-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* モーダルコンテンツ - 全幅対応 */
.world-clock-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    width: 95%;
    max-width: 800px; /* 最大幅を拡大 */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    animation: modalSlideIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    to {
        transform: scale(1);
    }
}

/* 閉じるボタン */
.world-clock-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    line-height: 1;
}

.world-clock-modal-close:hover {
    color: #ff6b6b;
    transform: scale(1.2);
}

/* モーダル内時計の全幅対応CSS */

/* モーダル内の時計コンテナ - 全幅中央配置 */
.modal-clock-container {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.modal-clock-container .jcgmt-lbl {
    font-size: 2.5em !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

/* モーダル内の時計ホルダー - 動的サイズ調整 */
.modal-clock-container .jcgmt-clockHolder {
    width: min(400px, 80vw) !important; /* ビューポート幅の80%、最大400px */
    height: min(400px, 80vw) !important;
    margin: 20px auto;
    position: relative;
    display: block;
    overflow: visible;
}

/* モーダル内の時計面 - 動的サイズ */
.modal-clock-container .jcgmt-clock {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    object-fit: contain;
}

/* モーダル内の針の回転軸を正確に中央に配置 */
.modal-clock-container .jcgmt-rotatingWrapper {
    position: absolute;
    width: 100% !important;
    height: 100% !important;
    top: 0;
    left: 0;
    z-index: 2;
}

/* モーダル内の各針のサイズと位置調整 */
.modal-clock-container .jcgmt-sec,
.modal-clock-container .jcgmt-min,
.modal-clock-container .jcgmt-hour {
    width: 2px !important;
    height: 100% !important;
    position: absolute;
    left: 50% !important;
    top: 0 !important;
    transform-origin: 50% 50% !important;
    margin-left: -1px !important;
    z-index: 3;
}

/* 時針の調整 */
.modal-clock-container .jcgmt-hour {
    width: 4px !important;
    margin-left: -2px !important;
    z-index: 4;
}

/* 分針の調整 */
.modal-clock-container .jcgmt-min {
    width: 3px !important;
    margin-left: -1.5px !important;
    z-index: 5;
}

/* 秒針の調整 */
.modal-clock-container .jcgmt-sec {
    width: 1px !important;
    margin-left: -0.5px !important;
    z-index: 6;
}

/* デジタル時計の位置修正 - レスポンシブ対応 */
.modal-clock-container .jcgmt-digital {
    font-size: clamp(2em, 4vw, 3.5em) !important; /* レスポンシブフォントサイズ */
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin: 30px auto 20px auto;
    position: static !important;
    transform: none !important;
    width: auto !important;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    left: auto !important;
    bottom: auto !important;
    text-align: center;
    display: block;
}

/* 日付表示の位置修正 - レスポンシブ対応 */
.modal-clock-container .jcgmt-date {
    font-size: clamp(1.2em, 3vw, 1.8em) !important; /* レスポンシブフォントサイズ */
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 10px auto;
    position: static !important;
    transform: none !important;
    left: auto !important;
    bottom: auto !important;
    text-align: center;
    display: block;
    max-width: 90%;
}

/* 国旗表示の調整 - レスポンシブ対応 */
.modal-flag-display {
    width: min(100px, 15vw);
    height: min(75px, 11.25vw);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto 20px auto;
    border-radius: 8px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: block;
}

/* タイムゾーン情報の調整 - 全幅対応 */
.modal-timezone-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 30px auto 0 auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.modal-timezone-info h3 {
    margin: 0 0 15px 0;
    color: white;
    font-size: clamp(1.2em, 3vw, 1.6em);
    text-align: center;
}

.modal-timezone-info p {
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1em, 2.5vw, 1.2em);
    text-align: center;
    line-height: 1.4;
}

/* body固定用 */
body.modal-open {
    overflow: hidden;
}

/* レスポンシブ調整 */
@media screen and (max-width: 768px) {
    .world-clock-modal-content {
        padding: 20px;
        margin: 10px;
        width: calc(100% - 20px);
        max-width: none;
        border-radius: 15px;
    }
    
    .modal-clock-container .jcgmt-clockHolder {
        width: min(300px, 85vw) !important;
        height: min(300px, 85vw) !important;
    }
    
    .modal-clock-container .jcgmt-lbl {
        font-size: 2em !important;
        margin-bottom: 15px;
    }
    
    .modal-clock-container .jcgmt-digital {
        padding: 12px 20px;
        margin: 20px auto 15px auto;
    }
    
    .modal-timezone-info {
        margin: 20px auto 0 auto;
        padding: 15px;
        width: 95%;
    }
}

@media screen and (max-width: 480px) {
    .world-clock-modal-content {
        padding: 15px;
        margin: 5px;
        width: calc(100% - 10px);
        border-radius: 10px;
    }
    
    .modal-clock-container .jcgmt-clockHolder {
        width: min(250px, 90vw) !important;
        height: min(250px, 90vw) !important;
    }
    
    .modal-clock-container .jcgmt-lbl {
        font-size: 1.6em !important;
        margin-bottom: 10px;
    }
    
    .modal-flag-display {
        width: min(80px, 20vw);
        height: min(60px, 15vw);
    }
}
