/* =============================================
   ENAlert - Custom Alert / Modal Service Styles
   Replaces SweetAlert2
   ============================================= */

:root {
    --enalert-surface: #ffffff;
    --enalert-border: rgba(0, 0, 0, 0.08);
    --enalert-text: #1e293b;
    --enalert-subtext: #64748b;
    --enalert-overlay: rgba(15, 23, 42, 0.55);
    --enalert-radius: 16px;
    --enalert-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);

    --enalert-confirm-bg: #4f46e5;
    --enalert-confirm-hover: #4338ca;
    --enalert-deny-bg: transparent;
    --enalert-deny-border: rgba(0, 0, 0, 0.15);
    --enalert-deny-hover: rgba(0, 0, 0, 0.05);
    --enalert-cancel-bg: transparent;
    --enalert-cancel-hover: rgba(0, 0, 0, 0.04);

    --enalert-input-bg: #f8fafc;
    --enalert-input-border: #e2e8f0;
    --enalert-input-focus: #4f46e5;
}

/* Overlay */
.enalert-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--enalert-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.enalert-overlay.enalert-show {
    opacity: 1;
}

/* Panel */
.enalert-panel {
    position: relative;
    background: var(--enalert-surface);
    border: 1px solid var(--enalert-border);
    border-radius: var(--enalert-radius);
    box-shadow: var(--enalert-shadow);
    padding: 2rem 2rem 1.75rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.2s ease;
    opacity: 0;
}

.enalert-overlay.enalert-show .enalert-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Icon animasyonu — panel açılınca bir kez çalışır, göz yormaz */
@keyframes enalert-icon-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.18); opacity: 1; }
    80%  { transform: scale(0.94); }
    100% { transform: scale(1); }
}

/* Icon */
.enalert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    margin: 0 auto 1.6rem;
    font-size: 2.8rem;
    animation: enalert-icon-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
}

.enalert-icon-success { background: rgba(34, 197, 94, 0.18);  color: #22c55e; }
.enalert-icon-error   { background: rgba(239, 68, 68, 0.18);   color: #ef4444; }
.enalert-icon-warning { background: rgba(245, 158, 11, 0.18);  color: #f59e0b; }
.enalert-icon-info    { background: rgba(59, 130, 246, 0.18);  color: #3b82f6; }
.enalert-icon-question{ background: rgba(139, 92, 246, 0.18);  color: #8b5cf6; }

/* Title */
.enalert-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--enalert-text);
    text-align: center;
    margin: 0 0 0.5rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Body */
.enalert-body {
    font-size: 0.925rem;
    color: #4b5563;
    text-align: center;
    line-height: 1.65;
    margin: 0 0 1.25rem;
}

.enalert-body b, .enalert-body strong { color: var(--enalert-text); }

/* Input */
.enalert-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    color: var(--enalert-text);
    background: var(--enalert-input-bg);
    border: 1px solid var(--enalert-input-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin: 0 0 0.5rem;
    box-sizing: border-box;
}

.enalert-input:focus {
    border-color: var(--enalert-input-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.enalert-input::placeholder { color: var(--enalert-subtext); opacity: 0.7; }

/* Validation message */
.enalert-validation {
    font-size: 0.8rem;
    color: var(--enalert-error);
    text-align: center;
    margin: 0 0 0.75rem;
    min-height: 1.2em;
}

/* Buttons */
.enalert-actions {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.enalert-btn {
    padding: 0.55rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
    min-width: 90px;
    line-height: 1.4;
}

.enalert-btn:active { transform: scale(0.97); }
.enalert-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.enalert-btn-confirm {
    background: var(--enalert-confirm-bg);
    color: #fff;
}
.enalert-btn-confirm:hover:not(:disabled) { background: var(--enalert-confirm-hover); }

.enalert-btn-deny {
    background: var(--enalert-deny-bg);
    color: var(--enalert-text);
    border: 1px solid var(--enalert-deny-border);
}
.enalert-btn-deny:hover:not(:disabled) { background: var(--enalert-deny-hover); }

.enalert-btn-cancel {
    background: var(--enalert-cancel-bg);
    color: var(--enalert-subtext);
    border: 1px solid transparent;
}
.enalert-btn-cancel:hover:not(:disabled) { background: var(--enalert-cancel-hover); }

/* Loader spinner on confirm button */
.enalert-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: enalert-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes enalert-spin {
    to { transform: rotate(360deg); }
}

/* Toast mode */
.enalert-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.enalert-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--enalert-surface);
    border: 1px solid var(--enalert-border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    min-width: 260px;
    max-width: 380px;
    pointer-events: all;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.2s ease;
}

.enalert-toast.enalert-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.enalert-toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.enalert-toast-icon.success { color: #22c55e; }
.enalert-toast-icon.error   { color: #ef4444; }
.enalert-toast-icon.warning { color: #f59e0b; }
.enalert-toast-icon.info    { color: #3b82f6; }

.enalert-toast-text {
    font-size: 0.875rem;
    color: var(--enalert-text);
    flex: 1;
}

/* Scrollbar */
.enalert-panel::-webkit-scrollbar { width: 5px; }
.enalert-panel::-webkit-scrollbar-track { background: transparent; }
.enalert-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }

/* Responsive */
@media (max-width: 480px) {
    .enalert-panel { padding: 1.5rem 1.25rem 1.25rem; }
    .enalert-actions { flex-direction: column; }
    .enalert-btn { width: 100%; }
}
