﻿:root {
    --bg-main: #f4f6f9;
    --bg-card: #ffffff;
    --bg-header: #1a3a5c;
    --bg-header-dark: #0f2744;
    --primary: #2196F3;
    --accent: #00bcd4;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --text-dark: #1a1a2e;
    --text-gray: #5a6a7a;
    --text-light: #8a9aaa;
    --border: #e0e6ed;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Layout */
.app-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header - SEOZoom Style */
.app-header {
    background: linear-gradient(135deg, var(--bg-header) 0%, var(--bg-header-dark) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin: 0;
    color: white;
    width: 100%;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span {
    color: #4fc3f7;
}

/* Tabs - Modern Style */
.nav-tabs {
    background: var(--bg-header);
    display: flex;
    gap: 0;
    margin: 0 0 30px 0;
    padding: 0 30px;
    overflow-x: auto;
    width: 100%;
}

.nav-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 15px 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-tab.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
}

/* Cards - Clean White Style */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Stat Cards Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.stat-card .stat-icon.blue {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.stat-card .stat-icon.green {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.stat-card .stat-icon.orange {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.stat-card .stat-icon.purple {
    background: rgba(156, 39, 176, 0.15);
    color: #9c27b0;
}

.stat-card .stat-icon.cyan {
    background: rgba(0, 188, 212, 0.15);
    color: #00bcd4;
}

.stat-card .stat-icon.red {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.stat-card .stat-delta {
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-delta.positive {
    color: var(--success);
}

.stat-delta.negative {
    color: var(--danger);
}

/* Data Lists - SEOZoom Style */
.data-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.data-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-main);
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-main);
    font-size: 0.9rem;
}

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

.data-list .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}

.dot.blue {
    background: #2196F3;
}

.dot.green {
    background: #4caf50;
}

.dot.orange {
    background: #ff9800;
}

.dot.purple {
    background: #9c27b0;
}

.dot.cyan {
    background: #00bcd4;
}

.dot.red {
    background: #f44336;
}

.dot.yellow {
    background: #ffeb3b;
}

.data-list .value {
    font-weight: 600;
    color: var(--text-dark);
}

/* Forms - Clean Style */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-gray);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dark);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Buttons - Modern Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: var(--bg-main);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

.w-100 {
    width: 100%;
}

.mt-2 {
    margin-top: 10px;
}

.mt-4 {
    margin-top: 20px;
}

.mb-4 {
    margin-bottom: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-high,
.badge-danger {
    background: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}

.badge-medium,
.badge-warning {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

.badge-low,
.badge-success {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.badge-info {
    background: rgba(33, 150, 243, 0.15);
    color: var(--primary);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Analysis Results - Clean Style */
.analysis-result h3 {
    color: var(--bg-header);
    font-size: 1rem;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-main);
}

.analysis-result ul {
    padding-left: 0;
    list-style: none;
}

.analysis-result li {
    padding: 8px 0;
    color: var(--text-gray);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--bg-main);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.analysis-result li::before {
    content: 'â€¢';
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

/* Chart Container */
.chart-container {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    height: 280px;
    position: relative;
}

.chart-container h4 {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.chart-container canvas {
    max-height: 220px !important;
    height: 220px !important;
}

/* Brand Check Card */
.brand-check-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-left: 4px solid var(--success);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.brand-check-card.unknown {
    background: linear-gradient(135deg, #fff3e0 0%, #fbe9e7 100%);
    border-left-color: var(--warning);
}

.brand-check-card.negative {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border-left-color: var(--danger);
}

.brand-check-card h3 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 1rem;
}

.brand-check-card p {
    margin: 5px 0;
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Competitor Card */
.competitor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.competitor-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.competitor-card h4 {
    margin: 0 0 5px 0;
    color: var(--text-dark);
    font-size: 1rem;
}

.competitor-card a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.competitor-card a:hover {
    text-decoration: underline;
}

.competitor-card p {
    margin: 10px 0;
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* PDF Export Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .card,
    .data-section,
    .chart-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .btn {
        display: none !important;
    }
}

.pdf-export-wrapper {
    background: white;
    padding: 20px;
    color: #1a1a2e;
}

.pdf-export-wrapper h2,
.pdf-export-wrapper h3,
.pdf-export-wrapper h4 {
    color: #1a3a5c !important;
}

.pdf-export-wrapper .stat-card,
.pdf-export-wrapper .data-section,
.pdf-export-wrapper .chart-container {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
}

/* News Item */
.news-item {
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.news-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.news-item.selected {

/* CSS per Stampa (PDF) */
@media print {
    body * { visibility: hidden; }
    #pdf-export-content, #pdf-export-content * { visibility: visible; }
    #pdf-export-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px !important;
        background: white !important;
        color: black !important;
    }
    #pdf-export-content button { display: none !important; }
    .stat-card, .chart-container, .card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        background: white !important;
    }
    h2, h3 {
        page-break-after: avoid;
        color: #0d3b66 !important;
    }
    body { background: white !important; }
}
