/**
 * ==========================================
 *  JUTALOMPONT 2025 - UNIFIED ALERT CSS
 *  Single, Central Toast & Modal Styles
 * ==========================================
 * 
 * MEGSZÜNTETI:
 * - jp-alert.css
 * - jp-alert-2025.css
 * - modal-alert.css
 */

/* ============================================
   TOAST CONTAINER
   ============================================ */
.jpa-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.jpa-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-width: 400px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.jpa-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.jpa-toast.hiding {
    opacity: 0;
    transform: translateX(400px);
}

/* Toast Icon */
.jpa-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Toast Content */
.jpa-toast-content {
    flex: 1;
    min-width: 0;
}

.jpa-toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.jpa-toast-message {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

/* Toast Close Button */
.jpa-toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    padding: 0;
}

.jpa-toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* Toast Progress Bar */
.jpa-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    transform-origin: left;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ============================================
   TOAST TYPES
   ============================================ */
.jpa-toast.success {
    border-left: 4px solid #28a745;
}
.jpa-toast.success .jpa-toast-icon {
    color: #28a745;
}

.jpa-toast.error {
    border-left: 4px solid #dc3545;
}
.jpa-toast.error .jpa-toast-icon {
    color: #dc3545;
}

.jpa-toast.warning {
    border-left: 4px solid #ffc107;
}
.jpa-toast.warning .jpa-toast-icon {
    color: #ffc107;
}

.jpa-toast.info {
    border-left: 4px solid #17a2b8;
}
.jpa-toast.info .jpa-toast-icon {
    color: #17a2b8;
}

.jpa-toast.premium {
    border-left: 4px solid #ffd700;
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
}
.jpa-toast.premium .jpa-toast-icon {
    color: #ffd700;
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.jpa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.jpa-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* ============================================
   MODAL
   ============================================ */
.jpa-modal {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.jpa-modal.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Modal Sizes */
.jpa-modal.small { width: 400px; }
.jpa-modal.medium { width: 600px; }
.jpa-modal.large { width: 800px; }

/* Modal Header */
.jpa-modal-header {
    position: relative;
    padding: 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}

.jpa-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.jpa-modal-title i {
    font-size: 24px;
}

.jpa-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 18px;
}

.jpa-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Modal Body */
.jpa-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.jpa-modal-body p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    color: #333;
}

.jpa-modal-body p:last-child {
    margin-bottom: 0;
}

/* Modal Input */
.jpa-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    margin-top: 12px;
}

.jpa-modal-input:focus {
    outline: none;
    border-color: #007bff;
}

/* Modal Footer */
.jpa-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
}

/* Modal Buttons */
.jpa-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.jpa-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jpa-btn:active {
    transform: translateY(0);
}

.jpa-btn-success {
    background: #28a745;
    color: #fff;
}

.jpa-btn-success:hover {
    background: #218838;
}

.jpa-btn-error {
    background: #dc3545;
    color: #fff;
}

.jpa-btn-error:hover {
    background: #c82333;
}

.jpa-btn-warning {
    background: #ffc107;
    color: #212529;
}

.jpa-btn-warning:hover {
    background: #e0a800;
}

.jpa-btn-info {
    background: #17a2b8;
    color: #fff;
}

.jpa-btn-info:hover {
    background: #138496;
}

.jpa-btn-confirm {
    background: #007bff;
    color: #fff;
}

.jpa-btn-confirm:hover {
    background: #0069d9;
}

.jpa-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.jpa-btn-secondary:hover {
    background: #5a6268;
}

/* Modal Header Types */
.jpa-modal-header.success .jpa-modal-title { color: #28a745; }
.jpa-modal-header.error .jpa-modal-title { color: #dc3545; }
.jpa-modal-header.warning .jpa-modal-title { color: #ffc107; }
.jpa-modal-header.info .jpa-modal-title { color: #17a2b8; }
.jpa-modal-header.confirm .jpa-modal-title { color: #007bff; }

/* ============================================
   LOADING OVERLAY
   ============================================ */
.jpa-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.jpa-loading-overlay.active {
    display: flex;
    opacity: 1;
}

.jpa-loading-spinner {
    text-align: center;
}

.jpa-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.jpa-loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .jpa-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .jpa-toast {
        min-width: auto;
        max-width: 100%;
    }

    .jpa-modal.small,
    .jpa-modal.medium,
    .jpa-modal.large {
        width: 95%;
    }

    .jpa-modal-header,
    .jpa-modal-body,
    .jpa-modal-footer {
        padding: 16px;
    }

    .jpa-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ============================================
   DARK MODE SUPPORT (optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .jpa-toast {
        background: #2d3748;
        color: #fff;
    }

    .jpa-toast-message {
        color: #cbd5e0;
    }

    .jpa-modal {
        background: #2d3748;
        color: #fff;
    }

    .jpa-modal-header,
    .jpa-modal-footer {
        background: #1a202c;
        border-color: #4a5568;
    }

    .jpa-modal-input {
        background: #1a202c;
        border-color: #4a5568;
        color: #fff;
    }

    .jpa-modal-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
}
