/* Custom Modal System Styles */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
}

.custom-modal-container {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    position: relative;
}

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

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.modal-icon.success { background: #f1f8e9; color: #2E7D32; }
.modal-icon.error { background: #fef2f2; color: #e74c3c; }
.modal-icon.warning { background: #fffbeb; color: #f59e0b; }
.modal-icon.info { background: #f0f4ff; color: #1D4ED8; }
.modal-icon.danger { background: #fef2f2; color: #e74c3c; }

.modal-icon.success::after { content: '✓'; }
.modal-icon.error::after { content: '✕'; }
.modal-icon.warning::after { content: '!'; }
.modal-icon.info::after { content: 'i'; font-family: serif; }
.modal-icon.danger::after { content: '✕'; }

.custom-modal-title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.custom-modal-message {
    margin: 0 0 28px;
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

.custom-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
    max-width: 140px;
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-ok {
    background: #1a2b4c;
    color: white;
    box-shadow: 0 4px 12px rgba(26, 43, 76, 0.2);
}

.btn-ok:hover {
    background: #111d33;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 43, 76, 0.3);
}

.btn-ok:active { transform: translateY(0); }

.btn-cancel {
    background: #f1f5f9;
    color: #666;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: #444;
}

/* Success variant specific button colors */
.custom-modal-container.success .btn-ok { background: #2E7D32; box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2); }
.custom-modal-container.success .btn-ok:hover { background: #689F38; }

/* Error variant specific button colors */
.custom-modal-container.error .btn-ok { background: #e74c3c; box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2); }
.custom-modal-container.error .btn-ok:hover { background: #c0392b; }

/* Warning variant specific button colors */
.custom-modal-container.warning .btn-ok { background: #f59e0b; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
.custom-modal-container.warning .btn-ok:hover { background: #d97706; }

/* Info variant specific colors */
.custom-modal-container.info .btn-ok { background: #1D4ED8; box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2); }
.custom-modal-container.info .btn-ok:hover { background: #3b6bc1; }

/* Danger variant specific colors (for Delete/Cancel) */
.custom-modal-container.danger .btn-ok { background: #e74c3c; box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2); }
.custom-modal-container.danger .btn-ok:hover { background: #c0392b; }

/* Mobile optimization */
@media (max-width: 480px) {
    .custom-modal-container {
        padding: 24px;
        width: 85%;
    }
    .custom-modal-title { font-size: 1.3rem; }
    .modal-btn { padding: 10px 16px; }
}

/* Prompt textarea */
.custom-modal-input {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1a1a1a;
    background: #f8fafc;
    box-sizing: border-box;
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-modal-input:focus {
    outline: none;
    border-color: #1D4ED8;
    box-shadow: 0 0 0 3px rgba(74, 123, 214, 0.12);
    background: #fff;
}

/* Suggestion chips */
.custom-modal-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    text-align: left;
}

.modal-suggestion-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1.5px solid #d1d9e8;
    background: #f0f4ff;
    color: #1D4ED8;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    line-height: 1;
}

.modal-suggestion-chip:hover {
    background: #dce7ff;
    border-color: #1D4ED8;
    transform: translateY(-1px);
}

.modal-suggestion-chip.active {
    background: #1D4ED8;
    border-color: #1D4ED8;
    color: #fff;
    box-shadow: 0 3px 10px rgba(74, 123, 214, 0.3);
}
