/* style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.95;
    font-size: 16px;
}

.content {
    padding: 35px;
}

.upload-section {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 50px 40px;
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: #5568d3;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.upload-section h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 24px;
}

.upload-section p {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.6;
}

input[type="file"] {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.file-list {
    margin-top: 20px;
    text-align: left;
    background: white;
    padding: 20px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.file-list strong {
    color: #667eea;
    font-size: 15px;
}

.file-list ul {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.file-list li {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    font-size: 14px;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list li:before {
    content: "📄 ";
    margin-right: 8px;
}

.results-section {
    margin-top: 30px;
}

.log-result {
    background: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.log-result:hover {
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.log-result h3 {
    color: #667eea;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    padding: 22px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e5e7ff;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.15);
}

.stat-box .label {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-box .value {
    color: #333;
    font-size: 32px;
    font-weight: bold;
}

.issue {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 14px;
    border-left: 5px solid #fbbf24;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.issue:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.issue.critical {
    border-left-color: #ef4444;
    background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
}

.issue.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fffbeb 0%, #ffffff 100%);
}

.issue.info {
    border-left-color: #3b82f6;
    background: linear-gradient(to right, #eff6ff 0%, #ffffff 100%);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.issue-type {
    font-weight: 600;
    color: #333;
    margin-left: 10px;
    font-size: 15px;
}

.issue-count {
    background: rgba(0,0,0,0.08);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    color: #666;
}

.issue-description {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    padding-left: 5px;
}

.severity-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-critical {
    background: #ef4444;
    color: white;
}

.severity-warning {
    background: #f59e0b;
    color: white;
}

.severity-info {
    background: #3b82f6;
    color: white;
}

.no-issues {
    text-align: center;
    padding: 50px;
    color: #10b981;
    font-size: 20px;
    font-weight: 600;
}

.error {
    background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
    border: 2px solid #ef4444;
    color: #991b1b;
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 15px;
}

.summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.summary h2 {
    margin-bottom: 22px;
    font-size: 26px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
}

.summary-item {
    background: rgba(255,255,255,0.2);
    padding: 22px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.summary-item:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-3px);
}

.summary-item .label {
    font-size: 13px;
    opacity: 0.95;
    margin-bottom: 8px;
    font-weight: 500;
}

.summary-item .value {
    font-size: 36px;
    font-weight: bold;
}

.timeline-section {
    background: white;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 30px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: 2px solid #e5e7ff;
}

.timeline-section h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-intro {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    font-style: italic;
}

#timelineChart {
    max-height: 300px;
}

.correlation-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 30px;
}

.correlation-section h2 {
    color: #0369a1;
    margin-bottom: 10px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.correlation-intro {
    color: #075985;
    font-size: 14px;
    margin-bottom: 20px;
    font-style: italic;
}

.correlation-item {
    background: white;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 5px solid #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.correlation-item.critical {
    border-left-color: #ef4444;
    background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
}

.correlation-item.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fffbeb 0%, #ffffff 100%);
}

.correlation-item.info {
    border-left-color: #10b981;
    background: linear-gradient(to right, #ecfdf5 0%, #ffffff 100%);
}

.correlation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 15px;
}

.correlation-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    background: #0ea5e9;
    color: white;
}

.correlation-item.critical .correlation-badge {
    background: #ef4444;
}

.correlation-item.warning .correlation-badge {
    background: #f59e0b;
}

.correlation-item.info .correlation-badge {
    background: #10b981;
}

.correlation-description {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    padding-left: 5px;
}

.results-section {
    margin-top: 30px;
}

.results-section h3 {
    color: #666;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7ff;
}

.advice-section {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 28px;
    margin-top: 30px;
}

.advice-section h3 {
    color: #059669;
    margin-bottom: 18px;
    font-size: 22px;
}

.advice-section ul {
    list-style: none;
    padding: 0;
}

.advice-section li {
    padding: 12px 0;
    color: #065f46;
    font-size: 15px;
    line-height: 1.7;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.advice-section li:last-child {
    border-bottom: none;
}

.advice-section li:before {
    content: "💡 ";
    margin-right: 8px;
}

.advice-section strong {
    color: #047857;
}

.advice-section code {
    background: rgba(16, 185, 129, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #047857;
}

.destinations-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e5e7ff;
}

.destinations-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.destinations-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.destinations-table table {
    width: 100%;
    border-collapse: collapse;
}

.destinations-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.destinations-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.destinations-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.destinations-table tbody tr:hover {
    background: #f8f9ff;
}

.destinations-table tbody tr:last-child {
    border-bottom: none;
}

.destinations-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #333;
}

.destinations-table td.hostname {
    color: #667eea;
    font-family: 'Courier New', monospace;
}

.destinations-table td.ip {
    font-family: 'Courier New', monospace;
    color: #666;
}

.destinations-table td.port {
    color: #999;
    text-align: center;
}

.destinations-table td.count {
    text-align: center;
    color: #10b981;
    font-size: 16px;
}

/* PDF Export Button */
.pdf-export-section {
    text-align: right;
    margin-bottom: 20px;
}

.pdf-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Print Styles for PDF Export */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
    }
    
    /* Hide interactive elements */
    .upload-section,
    .pdf-export-section,
    .submit-btn,
    .upload-btn {
        display: none !important;
    }
    
    /* Optimize header for print */
    .header {
        background: #667eea;
        color: white;
        padding: 20px;
        page-break-after: avoid;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    /* Ensure content fits well */
    .content {
        padding: 20px;
    }
    
    /* Keep sections together */
    .log-result,
    .summary,
    .advice-section {
        page-break-inside: avoid;
        margin-bottom: 15px;
    }
    
    /* Simplify colors for print */
    .summary {
        background: #667eea;
        color: white;
        padding: 15px;
    }
    
    .issue {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .issue.critical {
        border-left: 4px solid #ef4444;
        background: #fef2f2;
    }
    
    .issue.warning {
        border-left: 4px solid #f59e0b;
        background: #fffbeb;
    }
    
    .issue.info {
        border-left: 4px solid #3b82f6;
        background: #eff6ff;
    }
    
    /* Optimize tables for print */
    .destinations-table table {
        width: 100%;
        border-collapse: collapse;
    }
    
    .destinations-table th,
    .destinations-table td {
        border: 1px solid #ddd;
        padding: 8px;
        font-size: 11px;
    }
    
    .destinations-table thead {
        background: #667eea;
        color: white;
    }
    
    /* Remove hover effects */
    .issue:hover,
    .log-result:hover,
    .stat-box:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Optimize spacing */
    .stats {
        gap: 10px;
    }
    
    .stat-box {
        padding: 12px;
        border: 1px solid #ddd;
    }
    
    /* Add page numbers */
    @page {
        margin: 1.5cm;
        @bottom-right {
            content: "Pagina " counter(page) " van " counter(pages);
        }
    }
    
    /* Ensure text is readable */
    * {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}