/* Unified Modal Design - CS2/CSGO Gaming Theme */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Bebas+Neue&family=Teko:wght@300;400;500;600;700&display=swap');

/* Modal Backdrop with Gaming Effect */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    position: fixed;
}

.modal-backdrop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 107, 26, 0.02) 10px,
        rgba(255, 107, 26, 0.02) 20px
    );
    pointer-events: none;
}

/* Modal Dialog Centering - Only when shown */
.modal.fade.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hide modal when not shown */
.modal.fade:not(.show) {
    display: none !important;
}

.modal-dialog {
    max-width: 700px !important;
    width: 90% !important;
    margin: auto !important;
}

.modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Modal Content - CS2 Gaming Style */
.modal-content,
.login-modal-content,
.user-profile-modal-content {
    background: linear-gradient(135deg, #161c2e 0%, #0a0e1a 100%) !important;
    border: 3px solid #ff6b1a !important;
    border-radius: 0 !important;
    box-shadow: 0 0 60px rgba(255, 107, 26, 0.4), inset 0 0 40px rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
    clip-path: polygon(
        0 20px, 20px 0,
        calc(100% - 20px) 0, 100% 20px,
        100% calc(100% - 20px), calc(100% - 20px) 100%,
        20px 100%, 0 calc(100% - 20px)
    ) !important;
    position: relative;
    overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 107, 26, 0.03) 10px,
        rgba(255, 107, 26, 0.03) 20px
    );
    pointer-events: none;
    z-index: 0;
}

.modal-content::after {
    content: 'CS2';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bebas Neue', cursive;
    font-size: 10rem;
    color: #ff6b1a;
    opacity: 0.03;
    letter-spacing: 20px;
    pointer-events: none;
    z-index: 0;
}

/* Modal Header - CS2 Style */
.modal-header {
    background: linear-gradient(135deg, #0a0e1a 0%, #161c2e 100%);
    padding: 20px 24px;
    border-bottom: 2px solid #ff6b1a;
    border-radius: 0;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
    position: relative;
    overflow: hidden;
}

.modal-title {
    color: #fff !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    text-shadow: 0 0 10px currentColor;
    transition: color 0.3s ease;
}

/* Random color classes for modal titles */
.modal-title.color-orange { color: #ff6b1a !important; text-shadow: 0 0 15px #ff6b1a; }
.modal-title.color-yellow { color: #ffd700 !important; text-shadow: 0 0 15px #ffd700; }
.modal-title.color-blue { color: #0e7fff !important; text-shadow: 0 0 15px #0e7fff; }
.modal-title.color-green { color: #00ff88 !important; text-shadow: 0 0 15px #00ff88; }
.modal-title.color-purple { color: #9b59ff !important; text-shadow: 0 0 15px #9b59ff; }
.modal-title.color-red { color: #ff4655 !important; text-shadow: 0 0 15px #ff4655; }
.modal-title.color-cyan { color: #00ffff !important; text-shadow: 0 0 15px #00ffff; }
.modal-title.color-pink { color: #ff69b4 !important; text-shadow: 0 0 15px #ff69b4; }

/* JavaScript for random colors */
/* Add this script to your pages:
<script>
document.addEventListener('DOMContentLoaded', function() {
    // Random colors for modal titles
    const colors = ['color-orange', 'color-yellow', 'color-blue', 'color-green', 'color-purple', 'color-red', 'color-cyan', 'color-pink'];
    
    // Apply random color when modal is shown
    $('.modal').on('show.bs.modal', function() {
        const title = $(this).find('.modal-title');
        const randomColor = colors[Math.floor(Math.random() * colors.length)];
        title.removeClass(colors.join(' ')).addClass(randomColor);
    });
});
</script>
*/

/* Modal Body */
.modal-body {
    padding: 25px !important;
    color: #e5e7eb !important;
    background: transparent !important;
}

/* Modal Footer */
.modal-footer {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(102, 126, 234, 0.2) !important;
    padding: 15px 25px !important;
}

/* Close Button */
.btn-close,
.btn-close-white {
    filter: brightness(0) invert(1) !important;
    opacity: 0.8 !important;
}

.btn-close:hover,
.btn-close-white:hover {
    opacity: 1 !important;
}

/* Form Controls in Modals */
.modal-content .form-control,
.modal-content .form-select,
.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content textarea,
.modal-content select {
    background: rgba(45, 49, 66, 0.8) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    color: #fff !important;
    padding: 12px 15px !important;
    border-radius: 10px !important;
}

.modal-content .form-control:focus,
.modal-content .form-select:focus,
.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    background: rgba(45, 49, 66, 1) !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    color: #fff !important;
    outline: none !important;
}

/* Labels */
.modal-content label,
.modal-content .form-label {
    color: #e5e7eb !important;
    font-size: 0.95rem !important;
    margin-bottom: 8px !important;
    font-weight: 500 !important;
}

/* Buttons in Modal */
.modal-content .btn {
    padding: 10px 25px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.modal-content .btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    color: white !important;
}

.modal-content .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3) !important;
}

.modal-content .btn-secondary {
    background: rgba(107, 114, 128, 0.2) !important;
    border: 1px solid rgba(107, 114, 128, 0.3) !important;
    color: #9ca3af !important;
}

.modal-content .btn-secondary:hover {
    background: rgba(107, 114, 128, 0.3) !important;
    color: #d1d5db !important;
}

.modal-content .btn-danger {
    background: linear-gradient(135deg, #dc3545, #b02a37) !important;
    border: none !important;
    color: white !important;
}

.modal-content .btn-danger:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(220, 53, 69, 0.3) !important;
}

.modal-content .btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: none !important;
    color: white !important;
}

.modal-content .btn-success:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3) !important;
}

/* Alert in modals */
.modal-content .alert {
    background: rgba(102, 126, 234, 0.1) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    color: #e5e7eb !important;
    border-radius: 10px !important;
}

/* Scrollbar in modal */
.modal-body::-webkit-scrollbar {
    width: 8px !important;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 10px !important;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-radius: 10px !important;
}

/* Responsive */
@media (max-width: 576px) {
    .modal-dialog {
        max-width: calc(100% - 20px) !important;
        width: calc(100% - 20px) !important;
        margin: 10px !important;
    }
    
    .modal-content {
        border-radius: 12px !important;
    }
}
