/**
 * Univerzális Modal Rendszer - Stílusok
 * 
 * @author Faly
 * @version 1.0
 * @date 2026-01-05
 */

/* ============================================
   BASE OVERLAY
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9000;
}

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

/* ============================================
   MODAL DIALOG
   ============================================ */

.modal-dialog {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-show .modal-dialog {
    transform: scale(1);
}

/* ============================================
   MÉRETEK
   ============================================ */

.modal-size-s {
    width: 400px;
    max-width: 90vw;
}

.modal-size-m {
    width: 600px;
    max-width: 90vw;
}

.modal-size-l {
    width: 800px;
    max-width: 95vw;
}

.modal-size-xl {
    width: 1000px;
    max-width: 95vw;
}

.modal-size-xxl {
    width: 1200px;
    max-width: 95vw;
}

/* ============================================
   HEADER
   ============================================ */

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================
   BODY
   ============================================ */

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    color: #ccc;
    line-height: 1.6;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   FOOTER
   ============================================ */

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #1a1a1a;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.3px;
}

.modal-footer .btn-secondary {
    background: rgba(75, 85, 99, 0.9);
    color: #fff;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.modal-footer .btn-secondary:hover {
    background: rgba(107, 114, 128, 1);
    border-color: rgba(156, 163, 175, 0.5);
    box-shadow: 0 4px 12px rgba(75, 85, 99, 0.4);
    transform: translateY(-2px);
}

.modal-footer .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.modal-footer .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
    transform: translateY(-2px);
    border-color: rgba(239, 68, 68, 0.8);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.8);
}

/* ============================================
   CLOSE BUTTON
   ============================================ */

.modal-close-btn {
    background: transparent;
    border: none;
    color: #999;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.modal-close-btn-absolute {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

/* ============================================
   SPINNER
   ============================================ */

.modal-spinner,
.modal-spinner-large {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: modal-spin 0.8s linear infinite;
}

.modal-spinner {
    width: 40px;
    height: 40px;
}

.modal-spinner-large {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

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

/* ============================================
   BUTTONS
   ============================================ */

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.6);
    transform: translateY(-2px);
}

.modal-btn-cancel {
    background: #444;
    color: #ccc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-btn-cancel:hover {
    background: #555;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* ============================================
   FORM
   ============================================ */

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-form-group input,
.modal-form-group textarea,
.modal-form-group select {
    padding: 12px 15px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modal-form-group input:focus,
.modal-form-group textarea:focus,
.modal-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.modal-form-group input::placeholder {
    color: #666;
}

/* ============================================
   CONFIRM & ALERT CONTENT
   ============================================ */

.modal-confirm-content,
.modal-alert-content {
    text-align: center;
    padding: 20px 0;
}

.modal-confirm-content p,
.modal-alert-content p {
    font-size: 1.1rem;
    margin: 0;
    color: #fff;
}

/* ============================================
   LOADING CONTENT
   ============================================ */

.modal-loading-content {
    text-align: center;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.modal-loading-content p {
    font-size: 1.1rem;
    margin: 0;
    color: #fff;
}

/* ============================================
   ANIMÁCIÓK
   ============================================ */

/* FADE */
.modal-animation-fade .modal-dialog {
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* SLIDE */
.modal-animation-slide .modal-dialog {
    animation: modal-slide-in 0.3s ease;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ZOOM */
.modal-animation-zoom .modal-dialog {
    animation: modal-zoom-in 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modal-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* NONE */
.modal-animation-none .modal-dialog {
    transition: none;
    animation: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .modal-dialog {
        max-height: 95vh;
    }
    
    .modal-size-s,
    .modal-size-m,
    .modal-size-l,
    .modal-size-xl,
    .modal-size-xxl {
        width: 95vw;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
        flex-wrap: wrap;
    }
    
    .modal-btn {
        flex: 1;
        min-width: 120px;
    }
}
