/**
 * AutoDrive モーダルアラートスタイル
 * 動画撮影時に見やすい大きなアラート表示
 */

.autodrive-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.autodrive-alert-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.autodrive-alert-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.autodrive-alert-content {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    padding: 4rem 5rem;
    max-width: 900px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 10001;
    transform: scale(0.9);
    transition: transform 0.3s ease, opacity 0.5s ease;
    animation: alertPulse 2s infinite;
    backdrop-filter: none;
}

.autodrive-alert-modal.fade-out .autodrive-alert-content {
    opacity: 0;
    transform: scale(0.95);
}

.autodrive-alert-modal.show .autodrive-alert-content {
    transform: scale(1);
}

.autodrive-alert-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 2.5rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10002;
    padding: 0;
    font-weight: 300;
}

.autodrive-alert-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.1);
}

.autodrive-alert-close:active {
    transform: scale(0.95);
}

.autodrive-alert-icon {
    font-size: 6rem;
    margin-bottom: 2rem;
    animation: iconPulse 1.5s infinite;
    line-height: 1;
}

.autodrive-alert-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.autodrive-alert-message {
    font-size: 1.4rem;
    color: #2a2a2a;
    line-height: 1.8;
    margin-top: 1.5rem;
    font-weight: 500;
}

/* 思考プロセス完了時のモーダルスタイル */
.autodrive-alert-completed .autodrive-alert-content {
    max-width: 1000px;
    padding: 4rem 5rem;
    text-align: left;
}

.autodrive-alert-completed .autodrive-alert-icon {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.autodrive-alert-completed .autodrive-alert-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.autodrive-alert-completed .autodrive-alert-message {
    font-size: 1.3rem;
    line-height: 1.8;
    max-height: 60vh;
    overflow-y: auto;
    padding: 1.5rem;
    background: #ffffff;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    color: #333;
}

.autodrive-alert-completed .autodrive-alert-message h1,
.autodrive-alert-completed .autodrive-alert-message h2,
.autodrive-alert-completed .autodrive-alert-message h3 {
    color: #667eea;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.autodrive-alert-completed .autodrive-alert-message p {
    margin-bottom: 1rem;
}

/* タイプ別のスタイル */
.autodrive-alert-thinking .autodrive-alert-content {
    border: 4px solid #667eea;
    background: #ffffff;
    background-image: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.autodrive-alert-thinking .autodrive-alert-title {
    color: #667eea;
}

.autodrive-alert-emergency .autodrive-alert-content {
    border: 4px solid #f44336;
    background: #ffffff;
    background-image: linear-gradient(135deg, rgba(244, 67, 54, 0.08) 0%, rgba(211, 47, 47, 0.08) 100%);
}

.autodrive-alert-emergency .autodrive-alert-title {
    color: #f44336;
}

.autodrive-alert-rerouting .autodrive-alert-content {
    border: 4px solid #ff9800;
    background: #ffffff;
    background-image: linear-gradient(135deg, rgba(255, 152, 0, 0.08) 0%, rgba(255, 143, 0, 0.08) 100%);
}

.autodrive-alert-rerouting .autodrive-alert-title {
    color: #ff9800;
}

.autodrive-alert-completed .autodrive-alert-content {
    border: 4px solid #4caf50;
    background: #ffffff;
    background-image: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(56, 142, 60, 0.08) 100%);
}

.autodrive-alert-completed .autodrive-alert-title {
    color: #4caf50;
}

.autodrive-alert-returning_to_start .autodrive-alert-content {
    border: 4px solid #2196f3;
    background: #ffffff;
    background-image: linear-gradient(135deg, rgba(33, 150, 243, 0.08) 0%, rgba(25, 118, 210, 0.08) 100%);
}

.autodrive-alert-returning_to_start .autodrive-alert-title {
    color: #2196f3;
}

/* プログレスバー */
.autodrive-alert-progress-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.autodrive-alert-progress-bar {
    width: 0%;
    height: 8px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.1s linear;
    margin-bottom: 0.5rem;
}

.autodrive-alert-progress-text {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    margin-bottom: 1rem;
}

.autodrive-alert-cancel-auto-close {
    display: block;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.autodrive-alert-cancel-auto-close:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.autodrive-alert-cancel-auto-close:active {
    transform: scale(0.95);
}

/* アニメーション */
@keyframes alertPulse {

    0%,
    100% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
    }
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .autodrive-alert-content {
        padding: 2.5rem 3rem;
        max-width: 95%;
    }

    .autodrive-alert-icon {
        font-size: 5rem;
    }

    .autodrive-alert-title {
        font-size: 2rem;
    }

    .autodrive-alert-message {
        font-size: 1.2rem;
    }

    .autodrive-alert-completed .autodrive-alert-content {
        padding: 2.5rem 3rem;
        max-width: 95%;
    }

    .autodrive-alert-completed .autodrive-alert-icon {
        font-size: 4rem;
    }

    .autodrive-alert-completed .autodrive-alert-title {
        font-size: 2rem;
    }

    .autodrive-alert-completed .autodrive-alert-message {
        font-size: 1.1rem;
        max-height: 50vh;
    }
}