/*===============================================
Modern Popup System - Malsara.lk
Author: Custom Theme Implementation
Description: Modern alert/confirm/prompt dialogs matching Ethereal Estate theme
Version: 1.0.0
================================================*/

/* CSS Variables - Using existing Ethereal Estate colors */
:root {
    --popup-primary: #C84B7A;
    --popup-heading: #8B1A3A;
    --popup-accent: #D4607E;
    --popup-soft: #E8A0B4;
    --popup-primary-hover: #B63E6C;
    --popup-bg-main: #FDF7F5;
    --popup-bg-alt: #F2EDE8;
    --popup-white: #FFFFFF;
    --popup-border: #E8E3DC;
    --popup-text-main: #1A1A1A;
    --popup-text-muted: #6B6560;
    --popup-success: #6FCF97;
    --popup-error: #E57373;
    --popup-warning: #F5C800;
    --popup-info: #D4607E; /* Changed to accent for info */
    --popup-card-shadow: 0 2px 8px rgba(0,0,0,0.04);
    --popup-glow-shadow: 0 8px 24px rgba(232, 160, 180, 0.25);
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(226, 225, 220, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Popup Container */
.popup-container {
    background: var(--popup-white);
    border-radius: 20px;
    box-shadow: var(--popup-glow-shadow);
    max-width: 480px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--popup-border);
}

.popup-overlay.active .popup-container {
    transform: scale(1) translateY(0);
}

/* Popup Header */
.popup-header {
    background: var(--popup-white);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-bottom: 1px solid var(--popup-border);
}

.popup-header.success {
    border-bottom: 2px solid var(--popup-success);
}

.popup-header.error {
    border-bottom: 2px solid var(--popup-error);
}

.popup-header.warning {
    border-bottom: 2px solid var(--popup-warning);
}

.popup-header.info {
    border-bottom: 2px solid var(--popup-info);
}

.popup-icon {
    width: 40px;
    height: 40px;
    background: var(--popup-bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--popup-primary);
    font-size: 20px;
    font-weight: bold;
}

.popup-header.success .popup-icon { color: var(--popup-success); background: rgba(111, 207, 151, 0.1); }
.popup-header.error .popup-icon { color: var(--popup-error); background: rgba(229, 115, 115, 0.1); }
.popup-header.warning .popup-icon { color: var(--popup-warning); background: rgba(245, 200, 0, 0.1); }
.popup-header.info .popup-icon { color: var(--popup-info); background: rgba(212, 96, 126, 0.1); }

.popup-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--popup-heading);
    flex: 1;
}

.popup-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--popup-text-muted);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: var(--popup-bg-alt);
    color: var(--popup-text-main);
}

/* Popup Body */
.popup-body {
    padding: 30px;
    background: var(--popup-white);
}

.popup-message {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--popup-text-main);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Popup Input Field */
.popup-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--popup-border);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--popup-text-main);
    background: var(--popup-bg-main);
    transition: all 0.3s ease;
    margin-top: 15px;
    outline: none;
}

.popup-input:focus {
    border-color: var(--popup-primary);
    background: var(--popup-white);
    box-shadow: 0 0 0 4px rgba(200, 75, 122, 0.1);
}

.popup-input::placeholder {
    color: var(--popup-text-muted);
}

/* Popup Footer */
.popup-footer {
    padding: 20px 30px;
    background: var(--popup-bg-main);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--popup-border);
}

.popup-footer.center {
    justify-content: center;
}

/* Popup Buttons */
.popup-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.popup-btn-cancel {
    background: transparent;
    color: var(--popup-primary);
    border: 1px solid var(--popup-primary);
}

.popup-btn-cancel:hover {
    background: #FDF0F4;
    color: var(--popup-primary);
    border-color: var(--popup-primary);
}

.popup-btn-confirm {
    background: var(--popup-primary);
    color: var(--popup-white);
}

.popup-btn-confirm:hover {
    background: var(--popup-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--popup-glow-shadow);
}

.popup-btn-confirm.primary {
    background: var(--popup-primary);
}

.popup-btn-confirm.success {
    background: var(--popup-success);
}

.popup-btn-confirm.error {
    background: var(--popup-error);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast-container.bottom-left {
    top: auto;
    bottom: 20px;
    right: auto;
    left: 20px;
}

.toast-container.bottom-right {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: auto;
}

.toast-container.top-left {
    top: 20px;
    right: auto;
    left: 20px;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--popup-card-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 320px;
    max-width: 420px;
    transform: translateX(120%);
    transition: all 0.4s ease;
    border-left: 4px solid var(--popup-primary);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--popup-success);
}

.toast.error {
    border-left-color: var(--popup-error);
}

.toast.warning {
    border-left-color: var(--popup-warning);
}

.toast.info {
    border-left-color: var(--popup-info);
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(111, 207, 151, 0.15);
    color: var(--popup-success);
}

.toast.error .toast-icon {
    background: rgba(229, 115, 115, 0.15);
    color: var(--popup-error);
}

.toast.warning .toast-icon {
    background: rgba(245, 200, 0, 0.15);
    color: var(--popup-warning);
}

.toast.info .toast-icon {
    background: rgba(74, 144, 226, 0.15);
    color: var(--popup-info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--popup-text-main);
    margin-bottom: 4px;
}

.toast-message {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--popup-text-muted);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--popup-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--popup-bg-alt);
    color: var(--popup-text-main);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-container {
        max-width: 90%;
        margin: 20px;
    }

    .popup-header {
        padding: 20px;
    }

    .popup-body {
        padding: 20px;
    }

    .popup-footer {
        padding: 15px 20px;
        flex-direction: column;
    }

    .popup-btn {
        width: 100%;
    }

    .toast {
        min-width: 280px;
        max-width: calc(100vw - 80px);
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast-container.bottom-left,
    .toast-container.bottom-right,
    .toast-container.top-left {
        left: 10px;
        right: 10px;
    }
}

/* End of Modern Popup Styles */
