/* ================================================================
   SACMA-UI — Custom Modal & Toast System
   Projenin koyu lacivert/mor temasına özgü bildirim sistemi
   ================================================================ */

/* ===== SHARED ===== */
.sacma-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 24, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 50000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}
.sacma-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* ===== MODAL PANEL ===== */
.sacma-modal {
    background: rgba(18, 14, 40, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    padding: 2.25rem 2.5rem 2rem;
    max-width: 460px;
    width: calc(100% - 2rem);
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 24px 64px rgba(0, 0, 0, 0.7),
        0 4px 16px rgba(0, 0, 0, 0.5);
    transform: scale(0.86) translateY(24px);
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.22s ease;
    position: relative;
    overflow: hidden;
}
.sacma-overlay.visible .sacma-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Subtle top glow line */
.sacma-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(180, 74, 255, 0.4), transparent);
}

/* ===== MODAL ICON ===== */
.sacma-modal-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.25rem;
    border: 2px solid transparent;
    position: relative;
}
.sacma-modal-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    opacity: 0.25;
    filter: blur(8px);
}

.sacma-modal-icon.success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
}
.sacma-modal-icon.success::after { background: #22c55e; }

.sacma-modal-icon.error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
}
.sacma-modal-icon.error::after { background: #ef4444; }

.sacma-modal-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
}
.sacma-modal-icon.warning::after { background: #f59e0b; }

.sacma-modal-icon.info {
    background: rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.45);
}
.sacma-modal-icon.info::after { background: #00f0ff; }

.sacma-modal-icon.question {
    background: rgba(180, 74, 255, 0.15);
    border-color: rgba(180, 74, 255, 0.5);
}
.sacma-modal-icon.question::after { background: #b44aff; }

/* ===== MODAL CONTENT ===== */
.sacma-modal-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 0.625rem;
    line-height: 1.25;
}

.sacma-modal-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.925rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.65;
    margin: 0 0 1.75rem;
}

/* ===== MODAL BUTTONS ===== */
.sacma-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.sacma-btn {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.65rem 1.75rem;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    letter-spacing: 0.02em;
    min-width: 120px;
}
.sacma-btn:hover { transform: translateY(-2px); }
.sacma-btn:active { transform: translateY(0); }

.sacma-btn-confirm {
    background: var(--primary, oklch(0.7357 0.1641 34.7));
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
}
.sacma-btn-confirm:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.45);
}

.sacma-btn-cancel {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.sacma-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.9);
}

/* ===== TOAST CONTAINER ===== */
.sacma-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 50001;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
    max-width: 340px;
    width: calc(100% - 2.5rem);
}

/* ===== SINGLE TOAST ===== */
.sacma-toast {
    background: rgba(15, 12, 32, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--sacma-toast-color, var(--primary));
    border-radius: 0.75rem;
    padding: 0.9rem 1rem 0.75rem;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.6),
        0 1px 4px rgba(0, 0, 0, 0.4);
    pointer-events: all;
    transform: translateX(120%);
    opacity: 0;
    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.sacma-toast.visible {
    transform: translateX(0);
    opacity: 1;
}
.sacma-toast.hiding {
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.sacma-toast-body {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.sacma-toast-emoji {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.sacma-toast-content { flex: 1; min-width: 0; }

.sacma-toast-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.sacma-toast-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    line-height: 1.45;
}

/* Progress bar */
.sacma-toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: var(--sacma-toast-color, var(--primary));
    opacity: 0.7;
    transform-origin: left;
    animation: sacmaToastProgress linear forwards;
}

/* Toast types */
.sacma-toast[data-type="success"] { --sacma-toast-color: #22c55e; }
.sacma-toast[data-type="error"]   { --sacma-toast-color: #ef4444; }
.sacma-toast[data-type="warning"] { --sacma-toast-color: #f59e0b; }
.sacma-toast[data-type="info"]    { --sacma-toast-color: #00f0ff; }

/* ===== KEYFRAMES ===== */
@keyframes sacmaToastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .sacma-modal { padding: 1.75rem 1.5rem 1.5rem; }
    .sacma-modal-title { font-size: 1.15rem; }
    .sacma-toast-container { top: 0.75rem; right: 0.75rem; }
}
