/* ===== HOMEPAGE STYLES ===== */

body {
    background: #f5f7fa;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #E89D0F 0%, #D67312 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 1.3em;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    background: white;
    color: #E89D0F;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    display: inline-block;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Ad Space — invisibile quando vuoto: appare solo l'annuncio reale */
.ad-space {
    text-align: center;
    margin-bottom: 20px;
    overflow: hidden;
}

.ad-space.sidebar {
    margin-bottom: 30px;
}

.ad-space.footer-banner {
    margin-top: 40px;
}

/* Tools Grid */
.section-title {
    font-size: 2.2em;
    margin-bottom: 15px;
    color: #333;
    font-weight: 700;
}

.section-subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 40px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin-top: 20px;
}

.main-content {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.tool-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #F9B517 0%, #EF8215 100%);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.tool-title {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.tool-description {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.tool-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.tool-badge.new {
    background: #fff3e0;
    color: #e65100;
}

.tool-badge.popular {
    background: #e3f2fd;
    color: #1565c0;
}

.tool-badge.premium {
    background: #fff3e0;
    color: #e65100;
}

/* Features Section */
.features {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin: 60px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.feature-text {
    color: #666;
    font-size: 0.95em;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.widget-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.popular-tools-list {
    list-style: none;
}

.popular-tools-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.popular-tools-list a {
    color: #F9B517;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s;
}

.popular-tools-list a:hover {
    color: #EF8215;
}

/* Stats */
.stats {
    background: linear-gradient(135deg, #F9B517 0%, #EF8215 100%);
    color: white;
    border-radius: 15px;
    padding: 40px;
    margin: 60px 0;
}

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

.stat-number {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    opacity: 0.9;
    font-size: 1em;
}

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

    .sidebar {
        position: static;
    }

    .hero h1 {
        font-size: 2em;
    }

    .hero p {
        font-size: 1.1em;
    }
}

@media (max-width: 600px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MOBILE RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 767px) {
    .hero h1 {
        font-size: 1.5em;
        padding: 0 10px;
    }

    .hero p {
        font-size: 1em;
        padding: 0 10px;
    }

    .hero {
        padding: 40px 10px;
    }

    .container {
        padding: 20px 10px;
    }

    .section-title {
        font-size: 1.5em;
        padding: 0 10px;
    }

    .section-subtitle {
        font-size: 1em;
        padding: 0 10px;
    }

    .tool-card {
        padding: 20px 15px;
    }

    .tool-title {
        font-size: 1.2em;
    }

    .tool-description {
        font-size: 0.9em;
    }

    .features {
        padding: 20px 15px;
        margin: 30px 0;
    }

    .feature-icon {
        font-size: 2em;
    }

    .feature-title {
        font-size: 1em;
    }

    .feature-text {
        font-size: 0.85em;
    }

    .stats {
        padding: 20px 15px;
        margin: 30px 0;
    }

    .stat-number {
        font-size: 2em;
    }

    .sidebar-widget {
        padding: 15px;
    }

    /* Hide fixed width ads on mobile */
    .ad-space.leaderboard ins[style*="728px"],
    .ad-space.footer-banner ins[style*="728px"] {
        display: none !important;
    }

    .ad-space.sidebar ins[style*="300px"] {
        display: none !important;
    }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== ADDITIONAL MOBILE OVERFLOW FIXES ===== */
@media (max-width: 767px) {
    .container {
        width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }
    
    .content-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .ad-space ins,
    .ad-space.leaderboard ins,
    .ad-space.footer-banner ins {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Force hide all large ads */
    ins.adsbygoogle[style*="728px"],
    ins.adsbygoogle[style*="468px"] {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
}
