/**
 * 資格試験カウントダウンマネージャー - フロントエンドスタイル（強化版）
 *
 * @package ExamCountdownManager
 */

/* ==========================================================================
   CSS変数定義（IE11以降対応）
   ========================================================================== */

:root {
    --ecm-primary-color: #334e68;
    --ecm-accent-color: #f9ca24;
    --ecm-text-color: #ffffff;
    --ecm-border-radius: 8px;
    --ecm-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --ecm-transition: all 0.3s ease;
    --ecm-font-family: 'Hiragino Kaku Gothic Pro', 'Meiryo', 'MS Gothic', sans-serif;
}

/* ==========================================================================
   基本リセット
   ========================================================================== */

.ecm-countdown *,
.ecm-exam-list *,
.ecm-exam-info * {
    box-sizing: border-box;
}

/* ==========================================================================
   カウントダウン基本スタイル
   ========================================================================== */

.ecm-countdown {
    background: var(--ecm-primary-color);
    color: var(--ecm-text-color);
    padding: 20px;
    text-align: center;
    font-weight: bold;
    border-radius: var(--ecm-border-radius);
    margin: 20px 0;
    box-shadow: var(--ecm-box-shadow);
    transition: var(--ecm-transition);
    font-family: var(--ecm-font-family);
    position: relative;
    overflow: hidden;
}

/* IE11フォールバック */
.no-css-custom-properties .ecm-countdown {
    background: #334e68;
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.ecm-countdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%
    );
    transition: left 0.6s ease;
}

.ecm-countdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.ecm-countdown:hover::before {
    left: 100%;
}

.ecm-exam-name {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--ecm-text-color);
    font-weight: 600;
}

.no-css-custom-properties .ecm-exam-name {
    color: #ffffff;
}

/* ==========================================================================
   カウントダウンスタイル - デフォルト
   ========================================================================== */

.ecm-countdown-default {
    position: relative;
}

.ecm-countdown-default .ecm-days-number {
    font-size: 2.5em;
    color: var(--ecm-accent-color);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    display: inline-block;
    transition: var(--ecm-transition);
}

.no-css-custom-properties .ecm-countdown-default .ecm-days-number {
    color: #f9ca24;
    transition: all 0.3s ease;
}

.ecm-countdown-default .ecm-days-number.ecm-number-changing {
    transform: scale(1.1);
}

/* ==========================================================================
   カウントダウンスタイル - シンプル
   ========================================================================== */

.ecm-countdown-simple {
    background: transparent;
    color: #333;
    border: 2px solid #ddd;
    box-shadow: none;
    backdrop-filter: blur(5px);
}

.ecm-countdown-simple .ecm-exam-name {
    color: #333;
}

.ecm-countdown-simple .ecm-days-number {
    color: #e74c3c;
    font-size: 2em;
    font-weight: 700;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .ecm-countdown-simple {
        background: rgba(44, 62, 80, 0.9);
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .ecm-countdown-simple .ecm-exam-name {
        color: #ecf0f1;
    }
}

/* ==========================================================================
   カウントダウンスタイル - 詳細表示
   ========================================================================== */

.ecm-countdown-detailed {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.ecm-time-unit {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px 10px;
    min-width: 80px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--ecm-transition);
}

.ecm-time-unit:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.ecm-time-unit .ecm-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--ecm-accent-color);
    line-height: 1;
    transition: var(--ecm-transition);
}

.no-css-custom-properties .ecm-time-unit .ecm-number {
    color: #f9ca24;
}

.ecm-time-unit .ecm-label {
    display: block;
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.9;
    font-weight: normal;
}

/* 縦並びレイアウト（小画面用） */
.ecm-vertical-layout .ecm-countdown-detailed {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ecm-vertical-layout .ecm-time-unit {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
}

.ecm-vertical-layout .ecm-time-unit .ecm-number {
    font-size: 1.5em;
}

/* ==========================================================================
   カウントダウンスタイル - コンパクト
   ========================================================================== */

.ecm-countdown-compact {
    padding: 10px 15px;
    font-size: 0.9em;
    display: inline-block;
    margin: 10px 0;
    min-width: 150px;
}

.ecm-countdown-compact .ecm-exam-name {
    font-size: 1em;
    margin-bottom: 5px;
}

.ecm-countdown-compact .ecm-days-number {
    font-size: 1.5em;
}

/* ==========================================================================
   カウントダウンスタイル - ヘッダー・フッター
   ========================================================================== */

.ecm-countdown-header,
.ecm-countdown-footer {
    background: linear-gradient(135deg, var(--ecm-primary-color) 0%, #2c3e50 100%);
    margin: 0;
    border-radius: 0;
    position: relative;
}

.no-css-custom-properties .ecm-countdown-header,
.no-css-custom-properties .ecm-countdown-footer {
    background: linear-gradient(135deg, #334e68 0%, #2c3e50 100%);
}

#ecm-header-countdown {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#ecm-footer-countdown {
    margin-top: auto;
}

/* ==========================================================================
   サイズバリエーション
   ========================================================================== */

.ecm-size-small {
    padding: 10px 15px;
    font-size: 0.9em;
}

.ecm-size-small .ecm-days-number {
    font-size: 1.8em;
}

.ecm-size-small .ecm-time-unit {
    min-width: 60px;
    padding: 10px 8px;
}

.ecm-size-medium {
    padding: 20px;
    font-size: 1em;
}

.ecm-size-large {
    padding: 30px;
    font-size: 1.2em;
}

.ecm-size-large .ecm-days-number {
    font-size: 3.5em;
}

.ecm-size-large .ecm-time-unit {
    min-width: 100px;
    padding: 20px 15px;
}

/* ==========================================================================
   試験終了状態
   ========================================================================== */

.ecm-countdown-finished {
    background: #6c757d;
    opacity: 0.8;
    position: relative;
}

.ecm-countdown-finished::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    pointer-events: none;
}

.ecm-finished-message {
    font-size: 1.5em;
    color: var(--ecm-accent-color);
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.no-css-custom-properties .ecm-finished-message {
    color: #f9ca24;
}

/* ==========================================================================
   試験一覧スタイル
   ========================================================================== */

.ecm-exam-list {
    margin: 20px 0;
    display: block;
}

.ecm-exam-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--ecm-border-radius);
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--ecm-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.no-css-custom-properties .ecm-exam-item {
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ecm-exam-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--ecm-primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: bottom;
}

.no-css-custom-properties .ecm-exam-item::before {
    background: #334e68;
}

.ecm-exam-item:hover,
.ecm-exam-item.ecm-hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--ecm-primary-color);
}

.no-css-custom-properties .ecm-exam-item:hover {
    border-color: #334e68;
}

.ecm-exam-item:hover::before {
    transform: scaleY(1);
}

.ecm-exam-title {
    margin: 0 0 10px 0;
    color: var(--ecm-primary-color);
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.3;
}

.no-css-custom-properties .ecm-exam-title {
    color: #334e68;
}

.ecm-exam-date {
    margin: 8px 0;
    color: #666;
    font-size: 0.95em;
}

.ecm-exam-countdown {
    margin: 10px 0;
}

.ecm-days-left {
    background: var(--ecm-primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-block;
    transition: var(--ecm-transition);
}

.no-css-custom-properties .ecm-days-left {
    background: #334e68;
}

.ecm-days-left:hover {
    transform: scale(1.05);
}

.ecm-status-finished {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    display: inline-block;
}

.ecm-exam-description {
    margin: 10px 0;
    color: #555;
    line-height: 1.5;
    font-size: 0.95em;
}

.ecm-exam-category {
    margin-top: 10px;
}

.ecm-category-badge {
    background: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: var(--ecm-transition);
}

.ecm-category-badge:hover {
    background: #dee2e6;
}

/* ==========================================================================
   カラム表示
   ========================================================================== */

.ecm-columns-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.ecm-columns-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ecm-columns-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ecm-columns-1 {
    display: block;
}

/* CSS Grid非対応ブラウザ用フォールバック */
@supports not (display: grid) {
    .ecm-columns-2,
    .ecm-columns-3,
    .ecm-columns-4 {
        display: flex;
        flex-wrap: wrap;
        margin: -10px;
    }
    
    .ecm-columns-2 .ecm-exam-item {
        width: calc(50% - 20px);
        margin: 10px;
    }
    
    .ecm-columns-3 .ecm-exam-item {
        width: calc(33.333% - 20px);
        margin: 10px;
    }
    
    .ecm-columns-4 .ecm-exam-item {
        width: calc(25% - 20px);
        margin: 10px;
    }
}

/* ==========================================================================
   試験情報表示
   ========================================================================== */

.ecm-exam-info {
    background: #f8f9fa;
    border-left: 4px solid var(--ecm-primary-color);
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 var(--ecm-border-radius) var(--ecm-border-radius) 0;
}

.no-css-custom-properties .ecm-exam-info {
    border-left-color: #334e68;
    border-radius: 0 8px 8px 0;
}

.ecm-exam-info-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--ecm-border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.no-css-custom-properties .ecm-exam-info-card {
    border-radius: 8px;
}

.ecm-exam-info-inline {
    display: inline-block;
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.ecm-info-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--ecm-primary-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.no-css-custom-properties .ecm-info-name {
    color: #334e68;
}

.ecm-info-date {
    color: #666;
    margin: 5px 0;
    font-size: 0.95em;
}

.ecm-info-countdown {
    background: var(--ecm-accent-color);
    color: #333;
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
    margin: 8px 0;
    font-size: 0.9em;
    transition: var(--ecm-transition);
}

.no-css-custom-properties .ecm-info-countdown {
    background: #f9ca24;
}

.ecm-info-countdown:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ecm-info-description {
    color: #555;
    margin: 10px 0;
    line-height: 1.5;
}

.ecm-info-category {
    font-size: 0.9em;
    color: #777;
}

.ecm-info-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ecm-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 5px 0;
}

.ecm-detail-label {
    font-weight: 500;
    color: #666;
    flex: 1;
}

.ecm-detail-value {
    font-weight: bold;
    color: var(--ecm-primary-color);
    text-align: right;
}

.no-css-custom-properties .ecm-detail-value {
    color: #334e68;
}

/* ==========================================================================
   エラー・メッセージ表示
   ========================================================================== */

.ecm-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    position: relative;
}

.ecm-error::before {
    content: '⚠';
    font-size: 1.2em;
    margin-right: 8px;
    color: #dc3545;
}

.ecm-no-exams {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: var(--ecm-border-radius);
    border: 2px dashed #dee2e6;
}

.no-css-custom-properties .ecm-no-exams {
    border-radius: 8px;
}

.ecm-progress-placeholder {
    background: #e2e3e5;
    border: 1px solid #d6d8db;
    color: #6c757d;
    padding: 20px;
    text-align: center;
    border-radius: var(--ecm-border-radius);
    margin: 20px 0;
    position: relative;
}

.no-css-custom-properties .ecm-progress-placeholder {
    border-radius: 8px;
}

.ecm-progress-placeholder::before {
    content: '🚧';
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

/* ==========================================================================
   ウィジェット用スタイル
   ========================================================================== */

.widget .ecm-countdown {
    margin: 0 0 20px 0;
    font-size: 0.9em;
}

.widget .ecm-exam-list {
    margin: 0;
}

.widget .ecm-exam-item {
    padding: 15px;
    margin-bottom: 10px;
}

.widget .ecm-exam-title {
    font-size: 1.1em;
    margin-bottom: 8px;
}

.widget .ecm-time-unit {
    min-width: 50px;
    padding: 8px 6px;
}

.widget .ecm-time-unit .ecm-number {
    font-size: 1.3em;
}

/* ==========================================================================
   レスポンシブデザイン
   ========================================================================== */

@media (max-width: 768px) {
    .ecm-countdown {
        padding: 15px;
        margin: 15px 0;
        font-size: 0.95em;
    }
    
    .ecm-countdown-detailed {
        gap: 10px;
    }
    
    .ecm-time-unit {
        min-width: 60px;
        padding: 10px 8px;
    }
    
    .ecm-time-unit .ecm-number {
        font-size: 1.5em;
    }
    
    .ecm-columns-2,
    .ecm-columns-3,
    .ecm-columns-4 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* CSS Grid非対応の場合 */
    @supports not (display: grid) {
        .ecm-columns-2 .ecm-exam-item,
        .ecm-columns-3 .ecm-exam-item,
        .ecm-columns-4 .ecm-exam-item {
            width: calc(100% - 20px);
        }
    }
    
    .ecm-exam-item {
        padding: 15px;
    }
    
    .ecm-exam-title {
        font-size: 1.2em;
    }
    
    .ecm-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .ecm-detail-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .ecm-countdown {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .ecm-exam-name {
        font-size: 1em;
    }
    
    .ecm-days-number {
        font-size: 2em !important;
    }
    
    .ecm-countdown-detailed {
        flex-direction: column;
        align-items: center;
    }
    
    .ecm-time-unit {
        display: inline-block;
        margin: 5px;
        min-width: 70px;
    }
    
    .ecm-exam-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .ecm-exam-title {
        font-size: 1.1em;
    }
    
    .ecm-size-large {
        padding: 15px;
        font-size: 1em;
    }
    
    .ecm-size-large .ecm-days-number {
        font-size: 2.5em;
    }
}

/* 超小画面対応 */
@media (max-width: 320px) {
    .ecm-countdown {
        padding: 8px;
        margin: 10px 0;
    }
    
    .ecm-time-unit {
        min-width: 50px;
        padding: 8px 6px;
    }
    
    .ecm-time-unit .ecm-number {
        font-size: 1.2em;
    }
    
    .ecm-exam-item {
        padding: 10px;
    }
}

/* ==========================================================================
   アニメーション効果
   ========================================================================== */

/* 表示アニメーション */
.ecm-countdown,
.ecm-exam-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.ecm-countdown.ecm-visible,
.ecm-exam-item.ecm-visible {
    opacity: 1;
    transform: translateY(0);
}

/* カウントダウンの緊急度アニメーション */
@keyframes countdownPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes countdownShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.ecm-countdown.ecm-urgent .ecm-days-number {
    animation: countdownPulse 2s infinite;
    color: #e74c3c;
}

.ecm-countdown.ecm-very-urgent .ecm-days-number {
    animation: countdownPulse 1s infinite, countdownShake 0.5s infinite;
    color: #c0392b;
}

/* 数値変更アニメーション */
.ecm-number-changing {
    animation: numberChange 0.3s ease;
}

@keyframes numberChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: var(--ecm-accent-color); }
    100% { transform: scale(1); }
}

.no-css-custom-properties .ecm-number-changing {
    animation: numberChangeFallback 0.3s ease;
}

@keyframes numberChangeFallback {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #f9ca24; }
    100% { transform: scale(1); }
}

/* ローディングアニメーション */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.ecm-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* ==========================================================================
   ダークモード対応
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ecm-countdown-simple {
        background: rgba(44, 62, 80, 0.9);
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .ecm-countdown-simple .ecm-exam-name {
        color: #ecf0f1;
    }
    
    .ecm-exam-item {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .ecm-exam-title {
        color: #3498db;
    }
    
    .ecm-exam-date,
    .ecm-exam-description {
        color: #bdc3c7;
    }
    
    .ecm-exam-info {
        background: #34495e;
        color: #ecf0f1;
    }
    
    .ecm-category-badge {
        background: #34495e;
        color: #ecf0f1;
    }
    
    .ecm-no-exams {
        background: #2c3e50;
        border-color: #34495e;
        color: #bdc3c7;
    }
    
    .ecm-progress-placeholder {
        background: #34495e;
        border-color: #2c3e50;
        color: #bdc3c7;
    }
}

/* ==========================================================================
   印刷用スタイル
   ========================================================================== */

@media print {
    .ecm-countdown {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    .ecm-countdown *,
    .ecm-exam-item * {
        color: black !important;
    }
    
    .ecm-exam-item {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        margin-bottom: 10px !important;
    }
    
    .ecm-columns-2,
    .ecm-columns-3,
    .ecm-columns-4 {
        display: block !important;
    }
    
    .ecm-exam-item {
        margin-bottom: 15px !important;
    }
    
    /* アニメーションを無効化 */
    .ecm-countdown,
    .ecm-exam-item {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   アクセシビリティ
   ========================================================================== */

.ecm-countdown:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.ecm-exam-item:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.ecm-exam-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* スクリーンリーダー用のテキスト */
.screen-reader-text {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    word-wrap: normal !important;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .ecm-countdown {
        border: 2px solid;
    }
    
    .ecm-exam-item {
        border: 2px solid;
    }
    
    .ecm-days-left,
    .ecm-status-finished,
    .ecm-category-badge {
        border: 1px solid;
    }
    
    .ecm-time-unit {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
}

/* 動きを抑える設定 */
@media (prefers-reduced-motion: reduce) {
    .ecm-countdown,
    .ecm-exam-item,
    .ecm-time-unit,
    .ecm-days-left,
    .ecm-info-countdown {
        transition: none !important;
        animation: none !important;
    }
    
    .ecm-countdown:hover,
    .ecm-exam-item:hover {
        transform: none !important;
    }
    
    .ecm-countdown.ecm-urgent .ecm-days-number,
    .ecm-countdown.ecm-very-urgent .ecm-days-number {
        animation: none !important;
    }
    
    .ecm-countdown::before,
    .ecm-exam-item::before {
        transition: none !important;
    }
}

/* ==========================================================================
   IE11 特別対応
   ========================================================================== */

/* IE11でのFlexbox修正 */
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
    .ecm-countdown-detailed {
        display: -ms-flexbox;
        -ms-flex-pack: center;
        -ms-flex-align: end;
        -ms-flex-wrap: wrap;
    }
    
    .ecm-time-unit {
        -ms-flex: 0 0 auto;
    }
    
    .ecm-detail-item {
        display: -ms-flexbox;
        -ms-flex-pack: justify;
        -ms-flex-align: center;
    }
}

/* ==========================================================================
   カスタムプロパティのフォールバック
   ========================================================================== */

.no-css-custom-properties .ecm-countdown {
    background: #334e68;
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.no-css-custom-properties .ecm-days-number,
.no-css-custom-properties .ecm-time-unit .ecm-number {
    color: #f9ca24;
}

.no-css-custom-properties .ecm-exam-title,
.no-css-custom-properties .ecm-info-name {
    color: #334e68;
}

.no-css-custom-properties .ecm-exam-item::before {
    background: #334e68;
}

.no-css-custom-properties .ecm-days-left {
    background: #334e68;
}

/* ==========================================================================
   追加のユーティリティクラス
   ========================================================================== */

.ecm-text-center {
    text-align: center;
}

.ecm-text-left {
    text-align: left;
}

.ecm-text-right {
    text-align: right;
}

.ecm-hidden {
    display: none !important;
}

.ecm-visible {
    display: block !important;
}

.ecm-fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.ecm-slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px); 
    }
    to { 
        opacity: 1;
        transform: translateY(0); 
    }
}