/* style.css - AI Security Platform */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #343a40;
    --light: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary);
    margin-bottom: 10px;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: #666;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.logo h1 {
    color: var(--primary);
    font-size: 24px;
}

.logo small {
    font-size: 12px;
    color: #666;
}

.nav-links a {
    color: #555;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.nav-links .logout {
    background: var(--danger);
    color: white;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card h2, .card h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-warning {
    background: var(--warning);
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-card.critical .stat-number {
    color: var(--danger);
}

/* Recent Activities */
.recent-activities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.activity-column {
    background: white;
    border-radius: 15px;
    padding: 20px;
}

.activity-item {
    border-left: 3px solid var(--primary);
    padding: 10px 15px;
    margin: 10px 0;
    background: var(--light);
    border-radius: 8px;
}

.severity-critical { color: var(--danger); font-weight: bold; }
.severity-high { color: #fd7e14; font-weight: bold; }
.severity-medium { color: var(--warning); }
.severity-low { color: var(--success); }

/* AI Response */
.ai-response {
    background: #f0f4ff;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border-left: 4px solid var(--primary);
    line-height: 1.6;
}

/* Payload List */
.payload-list {
    margin-top: 15px;
}

.payload-item {
    background: var(--light);
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.payload-item code {
    font-family: monospace;
    background: #333;
    color: #0f0;
    padding: 5px 10px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 12px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.data-table th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.data-table tr:hover {
    background: var(--light);
}

/* Log Tabs */
.log-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 20px;
    background: rgba(255,255,255,0.9);
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.3s;
}

.tab.active, .tab:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Risk Meter */
.risk-meter {
    margin: 20px 0;
}

.risk-bar {
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
}

.risk-fill {
    height: 100%;
    transition: width 0.5s;
}

/* Detection Badge */
.detection-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
}

.detection-badge.malicious {
    background: var(--danger);
    color: white;
}

.detection-badge.clean {
    background: var(--success);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links a {
        display: inline-block;
        margin: 5px;
        font-size: 12px;
    }
    
    .recent-activities {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .payload-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .data-table {
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .navbar, .log-tabs, button, .report-actions, form {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 20px;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card {
    animation: fadeIn 0.5s ease-out;
}