/* css/modal.css */

/* ===== CUSTOM MODALS ===== */

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.custom-modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-message {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.modal-message:last-child {
    margin-bottom: 0;
}

.modal-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.modal-input::placeholder {
    color: var(--text-light);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-footer .btn {
    min-width: 100px;
}

/* ===== ALERT STYLES ===== */

.modal-alert {
    text-align: center;
    padding: 10px 0;
}

.modal-alert svg {
    margin-bottom: 16px;
}

.modal-alert-info svg {
    color: var(--primary-color);
}

.modal-alert-success svg {
    color: var(--success-color);
}

.modal-alert-warning svg {
    color: var(--warning-color);
}

.modal-alert-error svg {
    color: var(--danger-color);
}

.modal-alert .modal-message {
    font-size: 1.05rem;
    margin-bottom: 0;
}

/* ===== CHOICES STYLES ===== */

.modal-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.modal-choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    color: var(--text-primary);
    text-align: left;
}

.modal-choice-btn:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(4px);
}

.modal-choice-btn svg {
    flex-shrink: 0;
    color: var(--text-light);
}

.modal-choice-btn:hover svg {
    color: var(--primary-color);
}

.modal-choice-btn.danger:hover {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

.modal-choice-btn.danger:hover svg {
    color: var(--danger-color);
}

/* ===== MOBILE ===== */

@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        max-width: none;
        margin: 10px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-choice-btn {
        padding: 12px 16px;
    }
}

/* ===== ANIMATIONS ===== */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.modal-input.error {
    border-color: var(--danger-color);
    animation: shake 0.3s ease;
}