/* responsive.css - Stili responsivi per mobile e tablet */

/* Tablet e Desktop piccolo */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Header */
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    nav {
        display: none;
    }

    nav.active {
        display: block;
    }

    /* Hero */
    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Grids */
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* Tool Detail */
    .tool-detail-header {
        flex-direction: column;
        text-align: center;
    }

    .tool-detail-logo {
        margin: 0 auto;
    }

    .tool-detail-info h1 {
        font-size: 2rem;
    }

    .pricing-table {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    /* Typography */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* Container */
    .container {
        padding: 0 0.75rem;
    }

    /* Logo */
    .logo h1 {
        font-size: 1.25rem;
    }

    .logo img {
        height: 40px;
    }

    /* Hero */
    .hero {
        padding: 2rem 0;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.875rem;
    }

    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 1.5rem;
    }

    .category-card .icon {
        font-size: 2rem;
    }

    /* Tools */
    .tools-grid {
        gap: 1rem;
    }

    .tool-card {
        padding: 1rem;
    }

    .tool-logo {
        width: 40px;
        height: 40px;
    }

    .tool-info h3 {
        font-size: 1rem;
    }

    /* Tool Detail */
    .tool-detail {
        padding: 0;
    }

    .tool-detail-header {
        padding: 1.5rem;
    }

    .tool-detail-logo {
        width: 80px;
        height: 80px;
    }

    .pricing-card {
        padding: 1.5rem;
    }

    .price {
        font-size: 1.5rem;
    }

    /* Forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.625rem;
        font-size: 0.875rem;
    }

    /* Rating Stars */
    .star {
        font-size: 1.5rem !important;
    }

    /* Reviews */
    .review-item {
        padding: 1rem;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Footer */
    .footer-content {
        text-align: center;
    }

    footer {
        padding: 2rem 0;
    }

    /* Spacing */
    section {
        margin: 2rem 0 !important;
    }

    /* Flexbox Adjustments */
    [style*="display: flex"] {
        flex-direction: column !important;
    }

    /* Grid Adjustments for Special Layouts */
    [style*="grid-template-columns: 1fr 2fr"],
    [style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Hide overflow */
    body {
        overflow-x: hidden;
    }

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

    /* Tables (if any) */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .container {
        padding: 0 0.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    .hero h2 {
        font-size: 1.5rem;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }

    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    nav,
    .btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .tool-card,
    .category-card {
        break-inside: avoid;
    }
}

/* Dark Mode adjustments (se necessario) */
@media (prefers-color-scheme: dark) {
    /* Già gestito dalle variabili CSS nel file principale */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .tool-card,
    .category-card {
        border-width: 2px;
    }
}

/* Mobile Menu Toggle Button (da aggiungere all'HTML se necessario) */
.mobile-menu-btn {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
}