/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal__content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
}

.modal__loading {
    margin-bottom: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal__message {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.modal__submessage {
    color: #666;
    margin-bottom: 1rem;
}

.modal__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.modal__action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: background-color 0.2s;
}

.modal__action--download {
    background-color: #3498db;
}

.modal__action--download:hover {
    background-color: #2980b9;
}

.modal__action--retry {
    background-color: #e74c3c;
    border: none;
    cursor: pointer;
}

.modal__action--retry:hover {
    background-color: #c0392b;
}

.modal__action--cancel {
    background-color: #95a5a6;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
}

.modal__action--cancel:hover {
    background-color: #7f8c8d;
}

.modal__error-message {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.modal__progress {
    margin: 1rem 0;
    text-align: center;
}

.modal__progress-text {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
    white-space: pre-line;
}

/* ステータスステップのスタイル */
.modal__status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem auto;
    max-width: 400px;
    position: relative;
    padding: 0 1rem;
}

.modal__status::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.modal__status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 5px;
    width: 33.333%;
    text-align: center;
}

.modal__status-step i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.modal__status-step span {
    color: #666;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    width: 100%;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal__status-step--active i {
    background: #3d98b4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(61, 152, 180, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(61, 152, 180, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(61, 152, 180, 0);
    }
}

.modal__status-step--active span {
    color: #3d98b4;
    font-weight: bold;
}

.modal__status-step--completed i {
    background: #4CAF50;
}

.modal__status-step--completed span {
    color: #4CAF50;
}

@media (max-width: 480px) {
    .modal__status {
        max-width: 100%;
        padding: 0 0.5rem;
    }

    .modal__status::before {
        left: 30px;
        right: 30px;
        top: 20px;
    }

    .modal__status-step {
        padding: 0 2px;
    }

    .modal__status-step i {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .modal__status-step span {
        font-size: 0.7rem;
        padding: 0 2px;
    }

    @keyframes pulse {
        0% {
            box-shadow: 0 0 0 0 rgba(61, 152, 180, 0.4);
        }
        70% {
            box-shadow: 0 0 0 8px rgba(61, 152, 180, 0);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(61, 152, 180, 0);
        }
    }
}

/* 閉じるボタンのスタイル */
.modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    transition: color 0.2s;
}

.modal__close:hover {
    color: #333;
}