/* ===== ADVANCED AUDIT STYLES ===== */

/* Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

.container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.main-header {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-img {
    width: 40px;
    height: 40px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

/* Menu Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 0.1rem 0; /* ridotto ulteriormente */
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.page-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.page-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* SEO Content Section */
.seo-content-section {
    margin-bottom: 3rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.content-card {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
    box-shadow: var(--shadow-strong);
}

.content-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.content-card strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.input-card {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.input-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.input-wrapper {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 1rem;
}

.input-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-help {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.input-help i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Loading Section */
.loading-section {
    margin-bottom: 2rem;
}

.loading-card {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.loading-header {
    margin-bottom: 2rem;
}

.loading-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #3b82f6);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.loading-steps {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--background-color);
    opacity: 0.5;
    transition: all 0.3s;
}

.step.active {
    opacity: 1;
    background: var(--primary-color);
    color: white;
}

.step.completed {
    opacity: 1;
    background: var(--success-color);
    color: white;
}

.step i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Results Section */
.results-section {
    margin-bottom: 2rem;
}

.report-header {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.report-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.report-title h2 {
    font-size: 2rem;
    color: var(--text-primary);
}

.report-actions {
    display: flex;
    gap: 1rem;
}

.report-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.report-url i {
    color: var(--primary-color);
}

/* Score Overview */
.score-overview {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    align-items: center;
}

.score-main-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.score-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: 700;
    color: white;
    background: var(--secondary-color);
    transition: all 0.3s;
}

.score-circle.excellent {
    background: var(--success-color);
}

.score-circle.good {
    background: var(--primary-color);
}

.score-circle.fair {
    background: var(--warning-color);
}

.score-circle.poor {
    background: var(--error-color);
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
}

.score-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-align: center;
}

.score-fraction {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.score-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.score-bars-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

.score-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.score-bar {
    height: 32px;
    background-color: #f1f5f9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    border-radius: var(--radius-lg);
    transition: width 0.8s ease-in-out;
    position: relative;
}

.score-bar.success .score-bar-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.score-bar.warning .score-bar-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.score-bar.error .score-bar-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.score-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-bar-number {
    font-size: 1.25rem;
    font-weight: 700;
}

.score-bar-item:nth-child(1) .score-bar-number {
    color: var(--success-color);
}

.score-bar-item:nth-child(2) .score-bar-number {
    color: var(--warning-color);
}

.score-bar-item:nth-child(3) .score-bar-number {
    color: var(--error-color);
}

.score-bar-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Audit Sections */
.audit-sections {
    display: grid;
    gap: 2rem;
}

.audit-section {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.section-title i {
    color: var(--primary-color);
}

/* Audit Items */
.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.audit-item:hover {
    background: var(--background-color);
}

.audit-item.success {
    border-left: 4px solid var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.audit-item.warning {
    border-left: 4px solid var(--warning-color);
    background: rgba(245, 158, 11, 0.05);
}

.audit-item.error {
    border-left: 4px solid var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.audit-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.audit-item.success .audit-icon {
    background: var(--success-color);
}

.audit-item.warning .audit-icon {
    background: var(--warning-color);
}

.audit-item.error .audit-icon {
    background: var(--error-color);
}

.audit-content {
    flex: 1;
}

.audit-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.audit-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.audit-details {
    background: var(--background-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.audit-recommendation {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.audit-recommendation strong {
    color: var(--primary-color);
}

/* Keywords Cloud */
.keywords-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.keyword-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.keyword-tag.secondary {
    background: var(--secondary-color);
}

.keyword-tag.low {
    background: var(--border-color);
    color: var(--text-secondary);
}

/* Preview Cards */
.preview-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.preview-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.preview-url {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.preview-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Error Section */
.error-section {
    margin-bottom: 2rem;
}

.error-card {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    color: var(--error-color);
    margin-bottom: 1rem;
}

.error-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Footer */
.main-footer {
    background: var(--text-primary);
    color: white;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header-content {
        flex-direction: row;
        gap: 1rem;
        justify-content: space-between;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--card-background);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-icon {
        width: 40px;
        height: 40px;
    }
    
        .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .content-card h3 {
        font-size: 1.2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .report-title {
        flex-direction: column;
        gap: 1rem;
    }
    
    .report-actions {
        justify-content: center;
    }
    
    .score-overview {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .score-bars-section {
        gap: 1rem;
    }
    
    .score-bar {
        height: 28px;
    }
    
    .score-bar-number {
        font-size: 1.125rem;
    }
    
    .loading-steps {
        flex-direction: column;
    }
    
    .step {
        min-width: auto;
    }
    
    .audit-item {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 2rem 0;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-icon {
        width: 32px;
        height: 32px;
    }
    
    .input-card,
    .loading-card,
    .report-header,
    .audit-section {
        padding: 1rem;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .score-title {
        font-size: 0.875rem;
    }
    
    .score-fraction {
        font-size: 1rem;
    }
    
    .score-bar {
        height: 24px;
    }
    
    .score-bar-number {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.audit-section {
    animation: fadeIn 0.5s ease-out;
}

.score-circle {
    animation: pulse 2s infinite;
}

.progress-fill {
    animation: slideIn 0.5s ease-out;
}

/* Print Styles */
@media print {
    .main-header,
    .main-footer,
    .input-section,
    .loading-section,
    .error-section,
    .report-actions {
        display: none !important;
    }
    
    .page-header {
        background: none !important;
        color: var(--text-primary) !important;
    }
    
    .audit-section {
        break-inside: avoid;
    }
    
    .score-overview {
        break-inside: avoid;
    }
}

/* Header Content Box - Styling per contenuti H1/H2 */
.header-content-box {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    display: inline-block;
    border: 1px solid #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.header-content-box:first-child {
    margin-top: 8px;
}

.header-content-box:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments for header content */
@media (max-width: 768px) {
    .header-content-box {
        font-size: 12px;
        padding: 6px 10px;
        margin: 3px 0;
    }
}

/* Warning Issues List - Styling per lista avvisi dettagliati */
.warning-issues-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.warning-issue-item {
    margin-bottom: 12px;
    padding: 10px;
    background: #ffffff;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.warning-issue-item:last-child {
    margin-bottom: 0;
}

.issue-category {
    display: inline-block;
    background: #f59e0b;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 4px;
}

.warning-issue-item strong {
    color: #1e293b;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.issue-description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

/* Responsive adjustments for warning issues */
@media (max-width: 768px) {
    .warning-issues-list {
        padding: 8px;
        margin: 8px 0 0 0;
    }
    
    .warning-issue-item {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .issue-category {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .warning-issue-item strong {
        font-size: 13px;
    }
    
    .issue-description {
        font-size: 12px;
    }
} 