/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    will-change: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #374151;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 40px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #d1d5db;
    position: relative;
    z-index: 1;
}

/* Content Layout */
.content {
    padding: 40px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Metric Section Styles */
.metric-section {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.metric-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

.metric-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    position: relative;
}

.metric-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
}

.metric-group {
    margin-bottom: 25px;
}

.metric-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.metric-btn {
    padding: 12px 18px;
    border: 2px solid #e5e7eb;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    color: #6b7280;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    user-select: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.metric-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.metric-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
    will-change: transform;
}

.metric-btn:hover::before {
    left: 100%;
}

.metric-btn.active {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    border-color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(30, 41, 59, 0.4);
}

.metric-btn.active:hover {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    transform: translateY(-3px) scale(1.02);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.result-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

.result-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.result-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    will-change: transform;
}

.result-card:hover::after {
    opacity: 1;
}

.result-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.result-score {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.result-formula {
    font-size: 0.9rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    background: rgba(248, 250, 252, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(5px);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.action-btn:hover {
    will-change: transform;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #374151;
    border: 2px solid rgba(209, 213, 219, 0.6);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Notes Section */
.notes {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 2px solid rgba(147, 197, 253, 0.5);
    border-radius: 15px;
    padding: 25px;
    font-size: 0.95rem;
    color: #1e40af;
    box-shadow: 0 8px 25px rgba(147, 197, 253, 0.2);
    position: relative;
    overflow: hidden;
}

.notes::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.notes strong {
    font-weight: 700;
    color: #1d4ed8;
}

/* Severity Colors */
.severity-critical .result-score {
    background: linear-gradient(135deg, #dc2626, #ef4444, #f87171);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.severity-high .result-score {
    background: linear-gradient(135deg, #ea580c, #f97316, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.severity-medium .result-score {
    background: linear-gradient(135deg, #d97706, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.severity-low .result-score {
    background: linear-gradient(135deg, #16a34a, #22c55e, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.severity-none .result-score {
    background: linear-gradient(135deg, #6b7280, #9ca3af, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header severity colors */
.header.severity-critical { 
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 50%, #dc2626 100%); 
}
.header.severity-high { 
    background: linear-gradient(135deg, #9a3412 0%, #c2410c 50%, #ea580c 100%); 
}
.header.severity-medium { 
    background: linear-gradient(135deg, #a16207 0%, #ca8a04 50%, #d97706 100%); 
}
.header.severity-low { 
    background: linear-gradient(135deg, #15803d 0%, #16a34a 50%, #22c55e 100%); 
}

/* Tooltip Styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

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

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

.modal-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

.close {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.mysql-scenario {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-left: 4px solid #3b82f6;
    padding: 20px;
    margin: 15px 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    color: white;
    z-index: 3000;
    animation: slideInNotification 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

@keyframes slideInNotification {
    from { transform: translateX(100%) scale(0.8); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.notification-success { 
    background: linear-gradient(135deg, #10b981, #059669); 
}
.notification-info { 
    background: linear-gradient(135deg, #3b82f6, #2563eb); 
}

/* Responsive Design */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .metric-btn {
        width: 100%;
        text-align: left;
    }

    .action-buttons {
        flex-direction: column;
    }

    .header h1 {
        font-size: 2rem;
    }

    .container {
        margin: 10px;
        border-radius: 15px;
    }

    .content {
        padding: 20px;
    }



