/* ============================================================================
   MALWARE DETECTION SYSTEM - MAIN STYLESHEET
   ============================================================================
   A professional, clean design for the malware detection web application.
   Built with Bootstrap 5 overrides and custom components.
   ============================================================================ */

/* ============================================================================
   CSS VARIABLES (CUSTOM PROPERTIES)
   ============================================================================ */
:root {
    /* Primary Colors */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    
    /* Status Colors */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    /* Neutral Colors */
    --dark-bg: #1a1a2e;
    --dark-secondary: #16213e;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    /* Spacing */
    --section-padding: 80px;
    --card-padding: 24px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed navbar */
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--light-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 56px; /* Navbar height */
}

/* Main content area */
.main-content {
    flex: 1;
    padding-bottom: var(--section-padding);
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.display-4 {
    font-weight: 800;
}

.lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================================
   NAVIGATION BAR
   ============================================================================ */

.navbar {
    background: linear-gradient(135deg, var(--dark-bg), var(--dark-secondary)) !important;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.navbar-brand i {
    color: var(--primary-light);
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    margin: 0 2px;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background: rgba(37, 99, 235, 0.2);
    color: #ffffff !important;
}

.navbar-nav .nav-link i {
    margin-right: 4px;
}

/* Dropdown menu */
.dropdown-menu {
    background: var(--dark-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-md);
    padding: 8px;
}

.dropdown-item {
    color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(37, 99, 235, 0.3);
    color: #ffffff;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color), var(--primary-light));
    padding: var(--section-padding) 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.stats-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--card-padding);
    font-weight: 600;
}

.card-body {
    padding: var(--card-padding);
}

/* Card with gradient border */
.card-gradient-border {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
}

.card-gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    border-radius: calc(var(--radius-lg) + 2px);
    z-index: -1;
    opacity: 0;
    transition: var(--transition-normal);
}

.card-gradient-border:hover::before {
    opacity: 1;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: #ffffff;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control.bg-light {
    background-color: #f0f9ff;
    border-color: var(--primary-light);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-label small {
    font-weight: 400;
}

/* File input styling */
input[type="file"] {
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
    cursor: pointer;
    transition: var(--transition-fast);
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* Radio buttons */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    text-transform: none;
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    border: none;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color), #059669) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706) !important;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.table thead th {
    background: var(--dark-bg);
    color: #ffffff;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #eff6ff;
}

.table-success {
    background-color: #f0fdf4 !important;
}

.table-success td {
    font-weight: 600;
}

/* ============================================================================
   PROGRESS BARS
   ============================================================================ */

.progress {
    height: 30px;
    border-radius: 15px;
    background: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.progress-bar {
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1s ease;
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: linear-gradient(135deg, var(--dark-bg), var(--dark-secondary)) !important;
    margin-top: auto;
}

.footer h5, .footer h6 {
    color: #ffffff;
    margin-bottom: 16px;
}

.footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer a {
    color: var(--text-light);
    transition: var(--transition-fast);
}

.footer a:hover {
    color: var(--primary-light);
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

/* Slide in from right */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

/* Pulse */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Shake for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.6s ease;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Text utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Background utilities */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.bg-gradient-success {
    background: linear-gradient(135deg, #059669, var(--success-color));
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc2626, var(--danger-color));
}

/* Border utilities */
.border-left-primary {
    border-left: 4px solid var(--primary-color);
}

.border-left-success {
    border-left: 4px solid var(--success-color);
}

.border-left-danger {
    border-left: 4px solid var(--danger-color);
}

/* Spacing utilities */
.section-padding {
    padding: var(--section-padding) 0;
}

.mt-section {
    margin-top: var(--section-padding);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Large devices (desktops) */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .stats-card {
        margin-top: 32px;
    }
}

/* Medium devices (tablets) */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
        --card-padding: 20px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section {
        text-align: center;
    }
    
    .hero-section .d-flex {
        justify-content: center;
    }
    
    .navbar-brand span {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
}

/* Small devices (phones) */
@media (max-width: 576px) {
    :root {
        --section-padding: 40px;
        --card-padding: 16px;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .display-1 {
        font-size: 3rem;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .progress {
        height: 20px;
    }
    
    .progress-bar {
        font-size: 0.75rem;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .navbar,
    .footer,
    .btn,
    form {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    body {
        padding-top: 0;
    }
    
    .main-content {
        padding: 0;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
}

/* ============================================================================
   DARK MODE (Optional - can be toggled)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode support */
    /*
    body {
        background: #0f172a;
        color: #e2e8f0;
    }
    
    .card {
        background: #1e293b;
        border-color: #334155;
    }
    
    .form-control {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    .form-control:focus {
        background: #1e293b;
    }
    */
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   TOOLTIP CUSTOMIZATION
   ============================================================================ */

.tooltip {
    font-family: var(--font-family);
}

.tooltip-inner {
    background: var(--dark-bg);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* ============================================================================
   SCROLLBAR CUSTOMIZATION
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ============================================================================
   CODE BLOCKS
   ============================================================================ */

pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}

code {
    color: var(--danger-color);
    background: #fef2f2;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

pre code {
    color: #e2e8f0;
    background: transparent;
    padding: 0;
}