/**
 * Petlton - モーダルコンポーネント
 * 全サイト共通のモーダルスタイル
 */

/* ===== モーダルオーバーレイ ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== モーダルコンテナ ===== */
.modal {
    background: var(--color-bg-white);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: all 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

/* ===== モーダルヘッダー ===== */
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-bg-light);
    color: var(--color-text-primary);
}

/* ===== モーダルボディ ===== */
.modal-body {
    padding: 2rem;
}

/* ===== モーダルフッター ===== */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ===== 確認モーダル ===== */
.modal-confirm .modal-body {
    text-align: center;
    padding: 3rem 2rem;
}

.modal-confirm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modal-confirm-icon.warning {
    color: var(--color-warning, #ffc107);
}

.modal-confirm-icon.danger {
    color: var(--color-error, #e91e63);
}

.modal-confirm-icon.success {
    color: var(--color-success, #28a745);
}

.modal-confirm-message {
    font-size: 1.1rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.modal-confirm-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* ===== 画像モーダル ===== */
.modal-image .modal-body {
    padding: 0;
}

.modal-image img {
    width: 100%;
    display: block;
    border-radius: 0 0 12px 12px;
}

/* ===== サクセスメッセージモーダル ===== */
.modal-success {
    text-align: center;
    padding: 3rem 2rem;
}

.modal-success-icon {
    font-size: 4rem;
    color: var(--color-success, #28a745);
    margin-bottom: 1rem;
}

.modal-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.modal-success-message {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

/* ===== エラーモーダル ===== */
.modal-error {
    text-align: center;
    padding: 3rem 2rem;
}

.modal-error-icon {
    font-size: 4rem;
    color: var(--color-error, #e91e63);
    margin-bottom: 1rem;
}

.modal-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.modal-error-message {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

/* ===== サイズバリエーション ===== */
.modal-small {
    max-width: 400px;
}

.modal-large {
    max-width: 900px;
}

.modal-fullscreen {
    max-width: 95%;
    max-height: 95vh;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .modal-large,
    .modal-fullscreen {
        max-width: 95%;
    }
}

/* ===== アニメーション ===== */
@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modal-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}
