/* ===========================================
   DETECTOR - Downdetector Style
   RisparmioCerto.it
   =========================================== */

/* NEW Hero Section - Brand Style */
.detector-hero-new {
    background: linear-gradient(135deg, #4281A4 0%, #44BB67 100%);
    padding: 3rem 0 5rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.detector-hero-new .container {
    position: relative;
    z-index: 2;
}

/* Breadcrumb */
.detector-hero-new .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.detector-hero-new .breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.detector-hero-new .breadcrumb a:hover {
    color: #fff;
}

.detector-hero-new .breadcrumb .separator {
    font-size: 0.7rem;
    opacity: 0.6;
    margin: 0 0.5rem;
}

.service-detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #fff;
}

.service-detail-header h1 {
    margin: 0;
    font-size: 2.2rem;
    color: #fff;
}

.detector-hero-new h1 {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.detector-hero-new .hero-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin: 0 0 2.5rem;
}

/* Search Bar */
.hero-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    background: transparent;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 4px;
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 1.2rem 1.5rem;
    font-size: 1rem;
    outline: none;
    color: #333;
    background: #fff;
    border-radius: 4px 0 0 4px;
}

.hero-search input::placeholder {
    color: #6c757d;
}

.hero-search button {
    background: #44BB67;
    border: none;
    padding: 1.2rem 2rem;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 0 4px 4px 0;
}

.hero-search button:hover {
    background: #008f4c;
}

.hero-search button i {
    color: #fff;
    font-size: 1.2rem;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.hero-stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hero-stat-alert .hero-stat-number {
    color: #ffc107; /* Yellow for alert in this blue theme, or keep red/orange */
}

/* Wave Effect & Animation */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    height: 120px;
    pointer-events: none;
    opacity: 0.4;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 100%;
}

.wave-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    animation: waveMove 3s ease-in-out infinite alternate;
}

.wave-line-2 {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    animation: waveMove 4s ease-in-out infinite alternate-reverse;
}

@keyframes waveMove {
    0% {
        transform: translateY(0) scaleY(1);
    }
    100% {
        transform: translateY(10px) scaleY(1.1);
    }
}

/* Animated line effect (optional) */
.detector-hero-new::before {
    display: none;
}

/* Alerts Section */
.detector-alerts-section {
    background: #f8f9fa;
    padding: 0;
}

.detector-alerts {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border: 1px solid #ffcccc;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-top: -2rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #c0392b;
}

.alert-header i {
    color: #e74c3c;
}

.alert-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alert-service-chip {
    background: #fff;
    color: #c0392b;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #ffcccc;
}

.alert-service-chip:hover {
    background: #c0392b;
    color: #fff;
    transform: scale(1.05);
}

/* Grid Section */
.detector-grid-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    color: #555;
}

.filter-btn:hover {
    border-color: #44BB67;
    color: #44BB67;
}

.filter-btn.active {
    background: #4281A4;
    border-color: #44BB67;
    color: #fff;
}

/* Category Section */
.category-section {
    margin-bottom: 2.5rem;
}

.category-title {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-title i {
    color: #44BB67;
}

/* Services Grid */
.services-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.service-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    border: 2px solid transparent;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: #44BB67;
}

.service-status {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.service-status i {
    font-size: 12px;
}

.service-status[data-status="up"] i { color: #28a745; }
.service-status[data-status="down"] i { color: #dc3545; }
.service-status[data-status="slow"] i { color: #ffc107; }
.service-status[data-status="issues"] i { color: #fd7e14; }
.service-status[data-status="unknown"] i { color: #6c757d; }

/* Service Logo */
.service-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.service-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.service-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-status-text {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

.service-reports {
    text-align: right;
    flex-shrink: 0;
}

.reports-count {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

.reports-count[data-reports="0"] {
    color: #28a745;
}

.reports-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
}

/* How it works */
.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.how-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.how-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4281A4, #44BB67);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.how-icon i {
    font-size: 1.5rem;
    color: #fff;
}

.how-card h4 {
    margin: 0 0 0.5rem;
    color: #333;
}

.how-card p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* FAQ */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.faq-item {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid #eff2f5;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.06);
    border-color: rgba(0, 168, 89, 0.2);
}

.faq-item h4 {
    margin: 0 0 1rem;
    color: #44BB67;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 700;
}

.faq-item h4 i {
    color: #44BB67;
    background: rgba(0, 168, 89, 0.08);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: -2px;
    transition: all 0.3s ease;
}

.faq-item:hover h4 i {
    background: #44BB67;
    color: #fff;
}

.faq-item p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===========================================
   SERVICE DETAIL PAGE
   =========================================== */

.service-detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.service-detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.service-detail-info h1 {
    margin: 0;
    font-size: 2rem;
}

.service-url {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-url:hover {
    color: #fff;
}

.service-detail-status {
    margin-left: auto;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
}

.service-detail-status[data-status="up"] .status-indicator { background: rgba(40,167,69,0.3); }
.service-detail-status[data-status="down"] .status-indicator { background: rgba(220,53,69,0.3); }
.service-detail-status[data-status="slow"] .status-indicator { background: rgba(255,193,7,0.3); }
.service-detail-status[data-status="issues"] .status-indicator { background: rgba(253,126,20,0.3); }

/* Detail Content */
.service-detail-content {
    padding: 2rem 0 3rem;
    background: #f8f9fa;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    gap: 1rem;
}

.quick-stat {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quick-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #44BB67;
}

.quick-stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* Chart Card */
.chart-card, .problems-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-card h3, .problems-card h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card h3 i, .problems-card h3 i {
    color: #44BB67;
}

.chart-container {
    height: 250px;
}

/* Data Source Card */
.data-source-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid #4281A4;
}

.data-source-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #555;
}

.data-source-info i {
    color: #44BB67;
}

.data-source-time {
    color: #888;
    font-size: 0.8rem;
    margin-left: auto;
}

.data-source-text {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Problems Bars */
.problem-bar {
    margin-bottom: 1rem;
}

.problem-bar:last-child {
    margin-bottom: 0;
}

.problem-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.problem-bar-track {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.problem-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4281A4, #44BB67);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.no-data {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Sidebar */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.report-card, .links-card, .related-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.report-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #333;
}

.report-card > p {
    margin: 0 0 1.25rem;
    color: #666;
    font-size: 0.9rem;
}

/* Problem Types */
.problem-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.problem-type-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.problem-type-option:hover {
    background: #e9ecef;
}

.problem-type-option input {
    accent-color: #44BB67;
}

.problem-type-label {
    font-size: 0.9rem;
    color: #333;
}

.btn-report {
    width: 100%;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-report:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}

.btn-report:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Feedback */
.report-feedback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-feedback.success {
    background: #d4edda;
    color: #155724;
}

.report-feedback.error {
    background: #fff3cd;
    color: #856404;
}

/* Links Card */
.links-card h4, .related-card h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: #333;
}

.links-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-card li {
    margin-bottom: 0.5rem;
}

.links-card a {
    color: #44BB67;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

/* Related Services */
.related-services {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.related-service {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.related-service:hover {
    background: #e9ecef;
}

/* Responsive */
@media (max-width: 992px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .detector-hero-new h1 {
        font-size: 1.8rem;
    }

    .detector-hero-new .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stat-number {
        font-size: 1.5rem;
    }

    .hero-search {
        flex-direction: column;
    }

    .hero-search button {
        padding: 0.75rem;
    }

    .service-detail-header {
        flex-direction: column;
        text-align: center;
    }

    .service-detail-status {
        margin-left: 0;
    }

    .quick-stats {
        flex-direction: column;
    }

    .services-row {
        grid-template-columns: 1fr;
    }

    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .filter-btn {
        flex-shrink: 0;
    }
}

/* Hero section for detail page */
.detector-hero {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    padding: 2rem 0 3rem;
    color: #fff;
}

.detector-hero .breadcrumb {
    margin-bottom: 1.5rem;
}

.detector-hero .breadcrumb a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

.detector-hero .breadcrumb a:hover {
    color: #fff;
}

.detector-hero .breadcrumb span {
    color: #fff;
}

.detector-hero .breadcrumb i {
    margin: 0 0.5rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}
