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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    color: #2d3748;
    margin-bottom: 10px;
}

.subtitle {
    color: #718096;
    font-size: 1.1em;
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-stats, .btn-dashboard-v2, .btn-link {
    padding: 8px 16px;
    font-size: 0.9em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-stats:hover, .btn-dashboard-v2:hover, .btn-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn {
    padding: 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-security {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-infra {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.btn-services {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.btn-full {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.status {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status.hidden {
    display: none;
}

.results {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    min-height: 400px;
}

.placeholder {
    text-align: center;
    padding: 100px 20px;
    color: #a0aec0;
    font-size: 1.2em;
}

.loading {
    text-align: center;
    padding: 100px 20px;
    color: #4299e1;
    font-size: 1.2em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f56565;
}

.report {
    animation: fadeIn 0.5s ease;
}

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

.report h2 {
    color: #2d3748;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.report h3 {
    margin: 25px 0 15px;
    color: #4a5568;
}

.critical, .high, .medium, .low {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.critical {
    background: #fed7d7;
    border-left: 4px solid #fc8181;
}

.critical h3::before {
    content: '🔴 ';
}

.high {
    background: #feebc8;
    border-left: 4px solid #f6ad55;
}

.high h3::before {
    content: '🟠 ';
}

.medium {
    background: #fefcbf;
    border-left: 4px solid #ecc94b;
}

.medium h3::before {
    content: '🟡 ';
}

.low {
    background: #c6f6d5;
    border-left: 4px solid #68d391;
}

.low h3::before {
    content: '🟢 ';
}

.report ul {
    list-style: none;
    margin-left: 0;
}

.report li {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.report li strong {
    color: #2d3748;
    display: block;
    margin-bottom: 5px;
}

.report li p {
    color: #718096;
    margin: 5px 0;
    font-size: 0.95em;
}

.recommendations {
    background: #ebf8ff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #4299e1;
}

.recommendations h3::before {
    content: '💡 ';
}

.metadata {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    color: #718096;
    font-size: 0.9em;
}

.metadata p {
    margin: 5px 0;
}

.risk-critical {
    color: #c53030;
    font-weight: bold;
    text-transform: uppercase;
}

.risk-high {
    color: #dd6b20;
    font-weight: bold;
    text-transform: uppercase;
}

.risk-medium {
    color: #d69e2e;
    font-weight: bold;
    text-transform: uppercase;
}

.risk-low {
    color: #38a169;
    font-weight: bold;
    text-transform: uppercase;
}

.history {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history h2 {
    color: #2d3748;
    margin-bottom: 20px;
}

#history-list {
    list-style: none;
}

#history-list li {
    padding: 15px;
    margin: 10px 0;
    background: #f7fafc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#history-list li:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.history-empty {
    color: #a0aec0;
    text-align: center;
    padding: 20px;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.history-item-type {
    font-weight: 600;
    color: #2d3748;
}

.history-item-time {
    color: #a0aec0;
    font-size: 0.85em;
}

.history-item-risk {
    font-size: 0.85em;
}

/* Statistics Panel */
.btn-stats {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.stats-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    animation: fadeIn 0.3s ease;
}

.stats-panel.hidden {
    display: none;
}

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

.stat-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #4299e1;
}

.stat-card.critical {
    border-left-color: #fc8181;
    background: #fff5f5;
}

.stat-card.high {
    border-left-color: #f6ad55;
    background: #fffaf0;
}

.stat-card.medium {
    border-left-color: #ecc94b;
    background: #fffff0;
}

.stat-card h3 {
    font-size: 0.9em;
    color: #718096;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #2d3748;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.chart-container {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 1.1em;
}

.chart-container canvas {
    max-height: 300px;
}

/* History Filters */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filters select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.filters select:hover {
    border-color: #667eea;
}

.filters select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-small {
    padding: 8px 16px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .filters select {
        flex: 1;
        min-width: 120px;
    }
}

/* Report Header with Copy Button */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.report-header h2 {
    margin: 0;
}

.btn-copy {
    padding: 10px 20px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.btn-copy:active {
    transform: translateY(0);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 350px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #48bb78;
    color: #2f855a;
}

.toast-error {
    border-left: 4px solid #f56565;
    color: #c53030;
}

.toast-info {
    border-left: 4px solid #4299e1;
    color: #2c5282;
}
