/*
Theme Name: OPW Navigator
Theme URI: https://opw.clean/navigator
Description: Frontend for OPW Interactive Market Navigator
Version: 1.0.0
Author: Federico De Megni
Author URI: https://spherica.it
License: GPL-2.0+
Text Domain: opw-navigator
*/

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

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
}

.header-content {
    display: flex;
    flex-direction: row;
    align-content: center;
    align-items: center;
    gap: 40px;
}

/* Theme Toggle */
.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;  /* ← CAMBIA DA absolute */
    top: auto;  /* ← RIMUOVI */
    right: auto;  /* ← RIMUOVI */
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Blocco unico: icona + titolo */
.sector-title-block {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

html.darkmode #sidebar-welcome h3{
    color:#fff;
}

.sector-title-block h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.sector-title-block .sector-detail-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    padding: 8px;
}

/* Dark mode */
html.dark-mode .sector-title-block h2 {
    color: #e0e0e0;
}

html.dark-mode .sector-title-block .sector-detail-icon {
    background: #2a2a2a;
}

/* Sector Header Bar */
.sector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #ffffff3b;
    border: 1px solid #fff;
    border-radius: 80px;
    margin-bottom: 20px;
    gap: 30px;
}

.back-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    background:#005a8b;
    padding: 10px 10px;
    border-radius: 50px;
}

.back-link:hover {
    color: #ffffff;
    background:#0078a8;
    text-decoration: none !important;
}

.sector-header-title {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.sector-header-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.sector-badge {
    background-color: #0078a8;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#scenario-tabs {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.scenario-tab-button {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.scenario-tab-button:hover {
    border-color: #0078a8;
    color: #0078a8;
}

.scenario-tab-button.active {
    background-color: #0078a8;
    color: white;
    border-radius: 50px;
}

/* Dark Mode - Sector Header */
html.dark-mode .sector-header {
    background-color: #222;
    border-bottom-color: #333;
}

html.dark-mode .sector-header-title h2 {
    color: #e0e0e0;
}

html.dark-mode .scenario-tab-button {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    color: #e0e0e0;
}

html.dark-mode .scenario-tab-button:hover {
    border-color: #0078a8;
    color: #0078a8;
}

html.dark-mode .scenario-tab-button.active {
    background-color: #0078a8;
    color: white;
}

/* Dark Mode */

html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode h6 {
    color: #e0e0e0;
}

html.dark-mode p,
html.dark-mode span,
html.dark-mode div {
    color: #e0e0e0;
}

html.dark-mode #sector-title,
html.dark-mode #sector-description {
    color: #e0e0e0;
}

html.dark-mode .sector-mini-label {
    color: #b0b0b0;
}

html.dark-mode #product-title,
html.dark-mode #product-subtitle {
    color: #e0e0e0;
}

html.dark-mode .specs-grid div {
    color: #e0e0e0;
    background-color: #333;
}

html.dark-mode #product-notes {
    color: #b0b0b0;
}

html.dark-mode .modal-tab-button {
    color: #e0e0e0;
}

html.dark-mode #case-study-text {
    color: #b0b0b0;
}

html.dark-mode .applications-list {
    color: #e0e0e0;
}

html.dark-mode .carousel-main,
html.dark-mode .carousel-thumbnails {
    background-color: #333;
}

html.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

html.dark-mode body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

html.dark-mode header {
    background: linear-gradient(135deg, #1a3a4a 0%, #0d2a3a 100%);
}

html.dark-mode .main-container {
    background-color: #1a1a1a;
}

html.dark-mode .content {
    background-color: #1a1a1a;
}

html.dark-mode .canvas-area {
    background-color: #080f1e;
}

html.dark-mode #city-grid-container {
    background-color: #080f1e;
}

html.dark-mode .sector-grid {
    background-color: #080f1e;
}

html.dark-mode .sector-mini-item {
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #e0e0e0;
}

html.dark-mode .sector-mini-item:hover {
    background-color: #333;
}

html.dark-mode .sidebar {
    background-color: #080f1e;
    border-left: 1px solid #333;
    color: #e0e0e0;
}

html.dark-mode #sidebar-welcome,
html.dark-mode #sidebar-hover,
html.dark-mode #sidebar-active {
    background-color: #080f1e;
    color: #e0e0e0;
}

html.dark-mode .sector-mini-label {
    color: #b0b0b0;
}

html.dark-mode .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

html.dark-mode .modal-content {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

html.dark-mode .modal-tab-button {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
}

html.dark-mode .modal-tab-button.active {
    background-color: #0078a8;
    color: white;
}

html.dark-mode .specs-grid {
    background-color: #333;
}

html.dark-mode .specs-grid div {
    color: #e0e0e0;
    border-color: #444;
}

html.dark-mode .product-notes {
    color: #b0b0b0;
}

html.dark-mode button,
html.dark-mode input,
html.dark-mode textarea {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
}

html.dark-mode a {
    color: #4da6d6;
}

html.dark-mode a:hover {
    color: #6bb6e6;
}

/* Layout */
#app {
    display: flex;
    height: 100vh;
    background: #fff;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #0078a8 0%, #005a8b 100%);
    color: white;
    padding: 20px 30px;
    display: flex;  /* ← AGGIUNGI */
    justify-content: space-between;  /* ← AGGIUNGI */
    align-items: center;  /* ← AGGIUNGI */
    position: relative;
}

header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.canvas-area {
    flex: 1;
    padding: 30px;
    overflow: auto;
    background: #e6f3fc;
}

.canvas-area h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.sidebar {
    width: 450px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
}

/* ========================================
   INTELLIGENT SIDEBAR — 3 STATES
   ======================================== */

.sidebar-state {
    animation: fadeIn 0.3s ease;
}

.sidebar-state.active {
    display: block !important;
}

.sidebar-state {
    display: none;  /* ← NASCONDI DI DEFAULT */
}

.sidebar-state.active {
    display: block !important;  /* ← MOSTRA SOLO QUANDO ACTIVE */
}

.scenario-header-content {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.scenario-icon-wrapper {
    flex-shrink: 0;
}

.scenario-header-icon {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.scenario-header-text {
    flex: 1;
}

.scenario-header-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: #333;
}

.scenario-header-meta {
    font-size: 0.8rem;
    color: #0078a8;
    font-weight: 600;
    margin-bottom: 8px;
}

.scenario-header-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* Interactive Guide */
.interactive-guide {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.interactive-guide h5 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.guide-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.guide-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
    color: #0078a8;
    font-weight: 600;
}

.guide-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: #333;
}

.guide-desc {
    font-size: 0.75rem;
    color: #666;
}

/* Dark Mode */
html.dark-mode .scenario-header-title {
    color: #e0e0e0;
}

html.dark-mode .scenario-header-description {
    color: #aaa;
}

html.dark-mode .interactive-guide h5 {
    color: #e0e0e0;
}

html.dark-mode .guide-item {
    background-color: #2a2a2a;
}

html.dark-mode .guide-title {
    color: #e0e0e0;
}

html.dark-mode .guide-desc {
    color: #aaa;
}

/* Welcome State */
#sidebar-welcome h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.sectors-mini-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.sector-mini-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.sector-mini-item:hover {
    background: #f0f8ff;
    border-left-color: #0078a8;
    transform: translateX(4px);
}

.sector-mini-item.live {
    border-left-color: #0078a8;
    background: #f0f8ff;
}

.sector-mini-label {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    font-weight: normal;
}

/* Hover State */
#hover-sector-content {
    text-align: center;
}

.hover-sector-color {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin: 0 auto 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hover-sector-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.hover-sector-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
}

.hover-explore-btn {
    background: #0078a8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.hover-explore-btn:hover {
    background: #005a7f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 168, 0.2);
}

/* Active State */
#active-sector-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.active-sector-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.active-sector-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Sidebar Scenario Tabs */
.sidebar-scenario-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.sidebar-scenario-tab {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-scenario-tab:hover {
    background: #e8f4f8;
    border-color: #0078a8;
    color: #0078a8;
}

.sidebar-scenario-tab.active {
    background: #0078a8;
    border-color: #0078a8;
    color: white;
}

/* Sidebar Pins List */
.sidebar-pins-list {
    margin-bottom: 20px;
}

.sidebar-pins-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.pins-list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-pin-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid #0078a8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-pin-number {
    width: 24px;
    height: 24px;
    background: #0078a8;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.sidebar-pin-label {
    flex: 1;
    font-weight: 500;
}

.sidebar-pin-item:hover {
    background: #e8f4f8;
    transform: translateX(4px);
}

.sidebar-pin-item.hovered {
    background: #e8f4f8;
    border-left-color: #005a7f;
}

.sidebar-pin-item.active {
    background: #d4e8f0;
    border-left-color: #005a7f;
    font-weight: 600;
}

/* Sidebar Brands */
.sidebar-brands {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #0078a8;
}

.brands-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.brands-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brand-badge-sidebar {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #0078a8;
    text-transform: uppercase;
}

/* ======================================== */

/* CityGrid Component */
.sector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sector-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sector-card:not(.coming-soon):hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.sector-card.coming-soon {
    opacity: 0.65;
    cursor: not-allowed;
}

.sector-color-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.sector-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 15px 0 8px 0;
    color: #333;
}

.sector-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.sector-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
}

.sector-badge {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-align: center;
}

/* Components */
svg {
    max-width: 100%;
    height: auto;
}

/* ========================================
   PRODUCT MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;              /* Mobile/Tablet: 90% */
    max-width: 1200px;       /* Limite massimo */
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

/* Tablet+ (1024px): 50% della larghezza */
@media (min-width: 1024px) {
    .modal-content {
        width: 50vw;         /* ← 50% della viewport width */
        max-width: 1200px;   /* Limite massimo su desktop */
    }
}

/* Desktop (1920px+): 50vw con limite più alto */
@media (min-width: 1920px) {
    .modal-content {
        width: 50vw;
        max-width: 1600px;   /* Più spazio su 4K */
    }
}

/* Touch 55": 50vw ma con margini */
@media (pointer: coarse) and (min-width: 1920px) {
    .modal-content {
        width: calc(50vw - 40px);  /* 50vw meno margini */
        max-width: 1600px;
        margin: 20px;
    }
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #333;
    transform: rotate(90deg);
}

/* Modal Header */
.modal-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.product-brand-logo {
    margin-bottom: 15px;
}

.brand-badge {
    display: inline-block;
    background: #0078a8;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

#product-title {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    margin: 10px 0 5px 0;
}

#product-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f9f9f9;
    padding: 0 30px;
    gap: 0;
}

.modal-tab-button {
    flex: 1;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.modal-tab-button.active {
    color: #0078a8;
    border-bottom-color: #0078a8;
}

.modal-tab-button:hover:not(.active) {
    color: #333;
}

/* Modal Body & Tab Content */
.modal-body {
    padding: 30px;
    min-height: 300px;
}

.modal-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.modal-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tab 1: Overview - Specs Grid */
.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.spec-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #0078a8;
}

.spec-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.spec-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.product-notes {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #0078a8;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

/* Tab 2: Photos - Carousel */
.photo-carousel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.carousel-main {
    background: #040a1a;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

/* Key Technologies */
.tech-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tech-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    background-color: #f9f9f9;
}

.tech-icon {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
    color: #0078a8;
    font-weight: 600;
}

.tech-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
    color: #333;
}

.sector-mini-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: white;
    transition: all 0.2s;
}

.sector-mini-item.live {
    border-color: #0078a8;
}

.sector-mini-item.live:hover {
    background-color: #f0f8fc;
    border-color: #0078a8;
    cursor: pointer;
}

.sector-mini-icon-wrapper {
    min-width: 40px;
}

.sector-mini-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.sector-mini-content {
    flex: 1;
    min-width: 0;
}

.sector-mini-label {
    font-size: 0.7rem;
    color: #999;
    font-weight: 500;
}

.sector-color-pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

/* Dark Mode */
html.dark-mode .sector-mini-item {
    background-color: #222;
    border-color: #333;
}

html.dark-mode .sector-mini-item.live:hover {
    background-color: #1a3a4a;
}

html.dark-mode .sector-mini-content {
    color: #e0e0e0;
}

html.dark-mode .sector-mini-content > div:nth-child(2) {
    color: #aaa;
}

.tech-desc {
    font-size: 0.75rem;
    color: #666;
}

/* By the Numbers */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    background: linear-gradient(135deg, #0078a8 0%, #005a7f 100%);
    color: white;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.95;
    line-height: 1.2;
}

/* Dark Mode */
html.dark-mode .tech-item {
    background-color: #2a2a2a;
}

html.dark-mode .tech-title {
    color: #e0e0e0;
}

html.dark-mode .tech-desc {
    color: #aaa;
}

.carousel-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carousel-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.carousel-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-thumbnail:hover,
.carousel-thumbnail.active {
    border-color: #0078a8;
    transform: scale(1.05);
}

/* Tab 3: Applications */
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.application-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #0078a8;
}

.application-icon {
    width: 40px;
    height: 40px;
    background: #e8f4f8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.application-text {
    flex: 1;
}

.application-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.application-brand {
    font-size: 11px;
    color: #0078a8;
    font-weight: 500;
}

/* Tab 4: Case Study */
.case-study-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#case-study-text {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    margin: 0;
}

.case-study-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.case-study-pill {
    background: #0078a8;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ======================================== */

/* Tabs */
.tabs {
    display: flex;
    background: #fff;
}

html.dark-mode .tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #080f1e;
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: #0078a8;
    border-bottom-color: #0078a8;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* ========================================
   SECTOR DETAIL & SCENARIO
   ======================================== */

#sector-detail-container {
    animation: fadeIn 0.3s ease;
}

.sector-card-icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 10px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.sector-card:hover .sector-card-icon {
    opacity: 1;
}

.sector-mini-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.application-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
}

.application-brand img {
    height: 30px;
    object-fit: contain;
}

.app-brand-logo {
    height: 30px;
    object-fit: contain;
    max-width: 80px;
}

.app-brand-text {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.app-actions {
    display: flex;
    gap: 10px;
}

.btn-pdf-view, .btn-pdf-download {
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid #0078a8;
    background: white;
    color: #0078a8;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-pdf-view:hover, .btn-pdf-download:hover {
    background: #0078a8;
    color: white;
}

html.dark-mode .application-item {
    border-color: #333;
    background-color: #222;
}

html.dark-mode .app-brand-text {
    color: #aaa;
}

.sector-detail-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 15px;
    display: inline-block;
    vertical-align: middle;
}

.brand-logo-img {
    height: 50px;
    object-fit: contain;
    max-width: 120px;
}

#product-brand:empty {
    display: none;
}

.sector-header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-brand-logos {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.brand-logo {
    height: 40px;
    object-fit: contain;
    max-width: 100px;
}

html.dark-mode .product-brand-logos {
    border-bottom-color: #333;
}

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

#sector-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

#sector-description {
    font-size: 14px;
    color: #666;
}

#back-to-grid {
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
}

#back-to-grid:hover {
    text-decoration: underline;
}

/* ========================================
   BASE: TABLET (1024px+)
   ======================================== */

.scenario-canvas {
    margin: 30px 0;
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

#scenario-svg {
    display: block;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 15px;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tab buttons leggermente più grandi su tablet */
.scenario-tab-button {
    padding: 12px 24px;
    font-size: 15px;
}

#sector-title {
    font-size: 28px;
}

header h1 {
    font-size: 26px;
}

header p {
    font-size: 14px;
}

.hotspot-number {
    width: 50px;
    height: 50px;
    font-size: 16px;
}

/* ========================================
   DESKTOP: Monitor Standard (1920px+)
   ======================================== */

@media (min-width: 1920px) {
    .scenario-canvas {
        height: 550px;
        margin: 30px 0;
    }
    
    .scenario-tab-button {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    #sector-title {
        font-size: 32px;
    }
    
    header h1 {
        font-size: 32px;
    }
    
    header p {
        font-size: 15px;
    }
    
    .hotspot-number {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }
}

/* ========================================
   TOUCH 55": Pannello Interattivo
   ======================================== */

@media (pointer: coarse) and (min-width: 1920px) {
    /* Nascondi sidebar, usa tutto lo spazio */
    .sidebar {
        display: none;
    }
    
    .content {
        flex: 1;
        flex-direction: column;
        overflow: hidden;
    }
    
    .canvas-area {
        flex: 1;
        padding: 40px;
        overflow: hidden;
    }
    
    #sector-detail-container {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    /* Scenario canvas: usa quasi tutto lo spazio */
    .scenario-canvas {
        flex: 1;
        margin: 20px 0;
        height: auto;
    }
    
    #scenario-svg {
        width: 100%;
        height: 100%;
    }
    
    /* ===== HEADER ===== */
    header {
        padding: 30px 50px;
    }
    
    header h1 {
        font-size: 48px;
    }
    
    header p {
        font-size: 20px;
    }
    
    .theme-toggle {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }
    
    /* ===== SECTOR HEADER ===== */
    .sector-header {
        padding: 25px 40px;
        gap: 40px;
    }
    
    .back-link {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    #sector-title {
        font-size: 48px;
    }
    
    /* ===== SCENARIO TABS ===== */
    #scenario-tabs {
        gap: 20px;
    }
    
    .scenario-tab-button {
        padding: 18px 36px;
        font-size: 20px;
        border-radius: 8px;
    }
    
    /* ===== HOTSPOT PINS ===== */
    .hotspot-number {
        width: 80px;
        height: 80px;
        font-size: 24px;
        font-weight: 700;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    
    .hotspot-pin:hover .hotspot-number {
        transform: translate(-50%, -50%) scale(1.4);
    }
    
    .hotspot-label {
        font-size: 18px;
        padding: 12px 24px;
        top: -45px;
    }
    
    /* ===== PRODUCT MODAL ===== */
    .modal-content {
        max-width: 1600px;
        width: 90%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 40px;
    }
    
    #product-title {
        font-size: 42px;
        margin: 15px 0 10px 0;
    }
    
    #product-subtitle {
        font-size: 20px;
    }
    
    .modal-tabs {
        padding: 0 40px;
    }
    
    .modal-tab-button {
        padding: 20px 32px;
        font-size: 18px;
    }
    
    .modal-body {
        padding: 40px;
        font-size: 18px;
    }
    
    /* ===== SPECS GRID ===== */
    .specs-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 24px;
    }
    
    .spec-item {
        padding: 24px;
    }
    
    .spec-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .spec-value {
        font-size: 20px;
    }
    
    .product-notes {
        padding: 24px;
        font-size: 16px;
        line-height: 1.8;
    }
    
    /* ===== PHOTOS CAROUSEL ===== */
    .carousel-thumbnail {
        width: 120px;
        height: 120px;
    }
    
    /* ===== APPLICATIONS ===== */
    .applications-list {
        gap: 20px;
    }
    
    .application-item {
        padding: 24px;
        gap: 20px;
    }
    
    .application-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .application-title {
        font-size: 16px;
    }
    
    .application-brand {
        font-size: 12px;
    }
    
    /* ===== CASE STUDY ===== */
    #case-study-text {
        font-size: 16px;
        line-height: 1.8;
    }
    
    .case-study-pill {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    /* ===== BUTTONS ===== */
    .modal-close {
        font-size: 40px;
        top: 20px;
        right: 20px;
    }
    
    .btn-pdf-view,
    .btn-pdf-download {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ========================================
   TABLET LANDSCAPE (orientamento fisso)
   ======================================== */

@media (min-width: 1024px) and (max-width: 1919px) {
    .scenario-canvas {
        height: 740px;
    }
    
    .scenario-tab-button {
        padding: 12px 22px;
        font-size: 14px;
    }
    
    #sector-title {
        font-size: 26px;
    }
    
    .hotspot-number {
        width: 48px;
        height: 48px;
        font-size: 15px;
    }
}

/* Brands Section */
.sidebar-brands {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #0078a8;
}

.brands-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.brands-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Brand item con logo */
.brand-item-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.brand-logo-wrapper {
    width: 70px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.brand-logo-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-logo-wrapper:hover {
    border-color: #0078a8;
    box-shadow: 0 4px 12px rgba(0, 120, 168, 0.15);
    transform: translateY(-2px);
}

/* Fallback badge (se logo non disponibile) */
.brand-badge-sidebar {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #0078a8;
    text-transform: uppercase;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.brand-badge-sidebar:hover {
    border-color: #0078a8;
    background: #f0f8ff;
}

/* Dark mode */
html.dark-mode .sidebar-brands {
    background-color: #2a2a2a;
    border-left-color: #0078a8;
}

html.dark-mode .brand-logo-wrapper {
    background: #333;
    border-color: #444;
}

html.dark-mode .brand-logo-wrapper:hover {
    border-color: #0078a8;
    box-shadow: 0 4px 12px rgba(0, 120, 168, 0.3);
}

html.dark-mode .brand-badge-sidebar {
    background: #333;
    border-color: #444;
    color: #4da6d6;
}

html.dark-mode .brand-badge-sidebar:hover {
    background: #1a3a4a;
    border-color: #0078a8;
}

@media (pointer: coarse) and (min-width: 1920px) {
    .brand-logo-wrapper {
        width: 100px;
        height: 70px;
    }
    
    .brand-logo-image {
        max-width: 90%;
        max-height: 90%;
    }
    
    .brands-list {
        gap: 16px;
    }
    
    .brands-title {
        font-size: 16px;
        margin-bottom: 20px;
    }
}

#scenario-svg:hover {
    filter: brightness(1.02);
}

/* Hotspot Pins */
#hotspots-container {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 100%;
    pointer-events: none;
}

#hotspots-container .hotspot-pin {
    pointer-events: auto;
}

.hotspot-pin {
    position: absolute;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
}

.hotspot-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0078a8;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.hotspot-pin:hover .hotspot-number {
    transform: translate(-50%, -50%) scale(1.3);
    background: #005a7f;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hotspot-label {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hotspot-pin:hover .hotspot-label {
    opacity: 1;
}

/* Hotspot Pin Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 120, 168, 0.7);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 10px rgba(0, 120, 168, 0);
    }
}

.hotspot-pin {
    border-radius: 50%;  /* ← AGGIUNGI QUESTA RIGA */
    animation: pulse 2s infinite;
}

/* Scenario Tabs */
#scenario-tabs {
    display: flex;
    border-radius: 50px;
    gap: 0;
}

.scenario-tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.scenario-tab-button:hover:not(.active) {
    color: #333;
    background: #f9f9f9;
}

/* ========================================
   ISOMETRIC CITY HUB STYLES
   ======================================== */

@keyframes pin-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0, 120, 168, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 18px rgba(0, 120, 168, 0.6);
    }
}

.isometric-container {
    position: relative;
    width: 100%;
    padding-bottom: 60%;
    background: #e5f0fb;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #fff;
}

.isometric-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.isometric-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.pins-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.iso-hotspot-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.iso-pin-number {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--sector-color) 0%, color-mix(in srgb, var(--sector-color) 80%, black) 100%);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 120, 168, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 21;
    
    /* Animazione pulsante */
    animation: pin-pulse 2s ease-in-out infinite;
}

.iso-hotspot-pin:hover .iso-pin-number {
    animation: none;
    transform: scale(1.25);
    box-shadow: 0 8px 20px rgba(0, 120, 168, 0.6);
}

.iso-pin-card {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 0.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 20;
}

.iso-hotspot-pin:hover .iso-pin-card {
    opacity: 1;
    visibility: visible;
}

.iso-pin-card::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

.iso-pin-card-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.iso-pin-card-desc {
    font-size: 11px;
    font-weight: 400;
}

.isometric-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 0.5px solid #e0e0e0;
    padding: 16px 20px;
    font-size: 13px;
    color: #666;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 15;
}

#iso-info-text {
    color: #333;
    font-weight: 500;
}

/* Dark mode support */
html.dark-mode .isometric-info-panel {
    background: #1a1a1a;
    border-top-color: #333;
}

html.dark-mode #iso-info-text {
    color: #fff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .iso-pin-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-width: 2px;
    }
    
    .iso-pin-card {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .iso-pin-card-title {
        font-size: 12px;
    }
    
    .iso-pin-card-desc {
        font-size: 10px;
    }
}

/* ========================================
   FINE ISOMETRIC STYLES
   ======================================== */

/* Responsive */
@media (max-width: 1024px) {
    #app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        max-height: 30vh;
    }

    .content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 20px;
    }

    .canvas-area {
        padding: 15px;
    }

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

    .modal-content {
        width: 95%;
    }
}