/* ==========================================
   PROFESSIONAL MODAL NOTIFICATION SYSTEM
   Updated for Rare Breed Games dark theme
   ========================================== */

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 18, 0.92);
    backdrop-filter: blur(4px);
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Container */
.modal-container {
    background: linear-gradient(135deg, #1e1e32 0%, #141428 100%);
    border: 2px solid #2a2a4a;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-header.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-bottom-color: rgba(16, 185, 129, 0.3);
}

.modal-header.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-bottom-color: rgba(239, 68, 68, 0.3);
}

.modal-header.warning {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 107, 53, 0.05) 100%);
    border-bottom-color: rgba(255, 107, 53, 0.3);
}

.modal-header.info {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15) 0%, rgba(0, 217, 255, 0.05) 100%);
    border-bottom-color: rgba(0, 217, 255, 0.3);
}

.modal-icon {
    font-size: 1.75em;
    line-height: 1;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.modal-header.success .modal-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.modal-header.error .modal-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.modal-header.warning .modal-icon {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
}

.modal-header.info .modal-icon {
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
}

.modal-title {
    color: #e2e8f0;
    font-size: 1.25em;
    font-weight: 600;
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Modal Body */
.modal-body {
    padding: 24px;
}

.modal-message {
    color: #94a3b8;
    font-size: 1em;
    line-height: 1.6;
    margin: 0 0 16px 0;
    font-family: 'Inter', system-ui, sans-serif;
}

.modal-message:last-child {
    margin-bottom: 0;
}

.modal-details {
    background: rgba(13, 13, 18, 0.5);
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.modal-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: #94a3b8;
    font-size: 0.95em;
}

.modal-detail-item:not(:last-child) {
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}

.modal-detail-label {
    color: #64748b;
}

.modal-detail-value {
    color: #e2e8f0;
    font-weight: 600;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-button {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    color: #e2e8f0;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    font-family: 'Inter', system-ui, sans-serif;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-button:hover {
    background: #2a2a4a;
    border-color: #3a3a5a;
    transform: translateY(-1px);
}

.modal-button:active {
    transform: translateY(0);
}

.modal-button.primary {
    background: linear-gradient(135deg, #ff6b35 0%, #e55a25 100%);
    border-color: #ff6b35;
    color: #ffffff;
}

.modal-button.primary:hover {
    background: linear-gradient(135deg, #ff7b45 0%, #f56a35 100%);
    border-color: #ff7b45;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.modal-button.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: #ffffff;
}

.modal-button.success:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    border-color: #34d399;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.modal-button.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: #ffffff;
}

.modal-button.danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border-color: #f87171;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Confirmation Modal Specific */
.modal-confirmation-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.modal-confirmation-buttons .modal-button {
    flex: 1;
}

/* Loading Spinner */
.modal-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 217, 255, 0.2);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Animation */
.success-checkmark {
    display: inline-block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    margin: 0 auto 20px auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.success-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    animation: checkmarkPop 0.4s ease 0.3s both;
}

@keyframes checkmarkPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Error Animation */
.error-icon {
    display: inline-block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    margin: 0 auto 20px auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.error-icon::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-50%, -50%) rotate(-10deg); }
    75% { transform: translate(-50%, -50%) rotate(10deg); }
}

/* Info Icon */
.info-icon {
    display: inline-block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d9ff 0%, #0ea5e9 100%);
    margin: 0 auto 20px auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3);
}

.info-icon::after {
    content: 'i';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    font-style: italic;
}

/* Warning Icon */
.warning-icon {
    display: inline-block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35 0%, #e55a25 100%);
    margin: 0 auto 20px auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.warning-icon::after {
    content: '!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2em;
    font-weight: bold;
}

/* Centered Icon Style */
.modal-body.centered {
    text-align: center;
}

/* Auto-close countdown */
.auto-close-countdown {
    color: #64748b;
    font-size: 0.875em;
    margin-top: 16px;
    text-align: center;
}

.auto-close-countdown span {
    color: #00d9ff;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .modal-container {
        max-width: 95%;
        margin: 16px;
        border-radius: 12px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-title {
        font-size: 1.125em;
    }

    .modal-icon {
        font-size: 1.5em;
        width: 40px;
        height: 40px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 12px 20px 20px;
        flex-direction: column;
    }

    .modal-button {
        width: 100%;
        padding: 14px 24px;
    }

    .modal-confirmation-buttons {
        flex-direction: column;
    }
}
