/**
 * Stackposts - Custom Responsive Styles
 * FODI SMM Platform - Optimized Layout
 */

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hide-on-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

.show-on-mobile {
    display: none;
}

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

/* ========================================
   BASE RESPONSIVE ADJUSTMENTS
   ======================================== */

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Container with proper max-width and responsive padding */
.container {
    width: 100%;
    max-width: 1280px; /* xl breakpoint */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px; /* sm */
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px; /* md */
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px; /* lg */
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px; /* xl */
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px; /* 2xl */
    }
}

/* ========================================
   SECTION SPACING - CONSISTENT PADDING
   ======================================== */

@media (max-width: 768px) {
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .py-20 {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .mb-12 {
        margin-bottom: 2rem;
    }

    .mb-10 {
        margin-bottom: 1.5rem;
    }
}

/* ========================================
   HERO SECTION
   ======================================== */

@media (max-width: 768px) {
    .pt-20 {
        padding-top: 4rem;
    }

    section.bg-blueGray-50 .w-full.lg\:w-1\/2 {
        padding: 1rem !important;
    }
}

/* ========================================
   GRID LAYOUTS - RESPONSIVE
   ======================================== */

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

    .gap-6 {
        gap: 1rem;
    }

    .gap-8 {
        gap: 1.5rem;
    }
}

/* ========================================
   CARDS - FEATURE CARDS
   ======================================== */

@media (max-width: 768px) {
    .p-6 {
        padding: 1rem;
    }

    .rounded-2xl {
        border-radius: 1rem;
    }

    /* Feature card icons smaller on mobile */
    .h-14.w-14 {
        height: 3rem;
        width: 3rem;
    }

    .h-48 {
        height: 10rem;
    }
}

/* ========================================
   TESTIMONIALS
   ======================================== */

@media (max-width: 768px) {
    .lg\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   FOOTER SECTION
   ======================================== */

@media (max-width: 768px) {
    section.py-24.md\:pb-32 h2 {
        font-size: 1.75rem !important;
        line-height: 2rem !important;
    }

    .pt-15 .flex-wrap.items-center.justify-between {
        flex-direction: column;
        align-items: center;
    }
}

/* ========================================
   PRICING SECTION
   ======================================== */

@media (max-width: 768px) {
    .pricing-container .flex-wrap {
        flex-direction: column;
    }

    .pricing-container .w-full.md\:w-1\/3,
    .lg\:w-1\/3 {
        width: 100%;
    }
}

/* ========================================
   HEADER / NAVIGATION
   ======================================== */

@media (max-width: 1024px) {
    .hidden.lg\:block {
        display: none;
    }
}

.fixed.top-0.left-0.bottom-0 nav {
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

/* ========================================
   COOKIE BANNER
   ======================================== */

@media (max-width: 768px) {
    .cookie-policy-bar .p-10 {
        padding: 1rem;
    }

    .cookie-policy-bar h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .cookie-policy-bar p {
        font-size: 0.875rem;
    }

    .cookie-policy-bar .flex.flex-wrap.justify-end {
        justify-content: center;
        margin-top: 1rem;
    }
}

/* ========================================
   BUTTONS RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .py-3.px-6 {
        padding: 0.75rem 1.25rem;
    }

    .inline-flex {
        width: 100%;
        justify-content: center;
    }

    .flex.flex-wrap.gap-3 {
        flex-direction: column;
    }
}

/* ========================================
   IMAGES RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .relative.mx-auto img {
        max-width: 100%;
        height: auto;
    }

    .max-w-md img,
    .max-w-lg img {
        max-width: 100%;
    }

    /* Hide decorative elements on mobile */
    .absolute.z-10.-left-8,
    .absolute.z-10.-right-4 {
        display: none;
    }
}

/* ========================================
   TYPOGRAPHY RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .text-4xl {
        font-size: 1.75rem !important;
        line-height: 2rem !important;
    }

    .text-3xl {
        font-size: 1.5rem !important;
        line-height: 1.75rem !important;
    }

    .text-lg {
        font-size: 1rem;
    }

    .text-base {
        font-size: 0.875rem;
    }
}

/* ========================================
   TAP TARGETS - ACCESSIBILITY
   ======================================== */

@media (max-width: 768px) {
    a, button {
        min-height: 44px;
    }
}

/* ========================================
   CUSTOM ROUNDED CORNERS
   ======================================== */

.rounded-4xl {
    border-radius: 2rem;
}

.rounded-7xl {
    border-radius: 3.5rem;
}

/* ========================================
   ANIMATIONS - Reduced motion
   ======================================== */

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

/* ========================================
   HOVER EFFECTS
   ======================================== */

.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

.transition {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* ========================================
   BADGE/LABEL STYLES
   ======================================== */

.inline-block.px-3.py-1 {
    display: inline-flex;
    align-items: center;
}

/* ========================================
   SOCIAL PLATFORMS SECTION - RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .flex.flex-wrap.justify-center.items-center.gap-8 > div {
        flex: 0 0 calc(50% - 1rem);
        justify-content: center;
    }

    .flex.items-center.gap-2 {
        flex-direction: column;
        text-align: center;
    }

    .fab.fa-3x {
        font-size: 2rem !important;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Critical CSS - Above the fold */
.bg-blueGray-50 {
    background-color: #f8fafc;
}

/* Reduce layout shift and ensure images stay within bounds */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ensure no horizontal overflow */
* {
    max-width: 100%;
}

html, body, div, section, main, header, footer, nav {
    max-width: none;
}

/* Smooth scroll anchors */
html {
    scroll-padding-top: 80px;
}

/* ========================================
   SPACING UNIFORMI
   ======================================== */

/* Hero section mobile fix */
@media (max-width: 768px) {
    section.bg-blueGray-50 .pt-28 {
        padding-top: 5rem !important;
    }

    section.bg-blueGray-50 .pb-16 {
        padding-bottom: 3rem !important;
    }
}

/* ========================================
   TYPOGRAPHY MIGLIORATA
   ======================================== */

h1, .text-hero {
    line-height: 1.1;
    letter-spacing: -0.025em;
}

h2 {
    line-height: 1.2;
    letter-spacing: -0.02em;
}

p.text-lg, p.text-xl {
    line-height: 1.7;
}

@media (max-width: 640px) {
    .text-6xl {
        font-size: 2.25rem !important;
    }

    .text-5xl {
        font-size: 1.875rem !important;
    }

    .text-4xl {
        font-size: 1.5rem !important;
    }
}

/* ========================================
   MOBILE EXPERIENCE
   ======================================== */

/* Social icons mobile */
@media (max-width: 640px) {
    .flex.flex-wrap.items-center.gap-3 {
        justify-content: center;
        gap: 0.75rem;
    }

    .fab.fa-2x {
        font-size: 1.5rem !important;
    }
}

/* Feature cards tablet */
@media (min-width: 640px) and (max-width: 1023px) {
    .w-full.md\:w-1\/3.p-3 {
        width: 50% !important;
    }
}

/* CTA section decorative images */
@media (max-width: 1024px) {
    .w-52, .w-56 {
        width: 7rem !important;
    }
}

@media (max-width: 640px) {
    .w-52, .w-56 {
        display: none !important;
    }
}

/* ========================================
   HEADER MIGLIORAMENTI
   ======================================== */

/* Logo responsive */
.h-9 {
    height: 2.25rem;
}

@media (min-width: 1024px) {
    header .h-9, nav .h-9 {
        height: 2.5rem;
    }
}

/* Mobile nav width */
@media (max-width: 640px) {
    .fixed.top-0.left-0.bottom-0.w-4\/6 {
        width: 80% !important;
        max-width: 300px;
    }
}

/* ========================================
   CTA BUTTONS MIGLIORATI
   ======================================== */

/* Button hover effects */
a.bg-indigo-600:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
}

a.bg-indigo-600, a.bg-transparent {
    transition: all 200ms ease-in-out;
}

/* Focus visible for accessibility */
a:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Mobile buttons */
@media (max-width: 640px) {
    .flex.flex-wrap.gap-4 {
        flex-direction: column;
        align-items: stretch;
    }

    .flex.flex-wrap.gap-4 > a {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   HERO SECTION BILANCIATO
   ======================================== */

@media (min-width: 1024px) {
    section.bg-blueGray-50 .lg\:w-1\/2:first-child {
        width: 45%;
    }

    section.bg-blueGray-50 .lg\:w-1\/2:last-child {
        width: 55%;
    }
}

/* Hero image container */
.max-w-lg {
    max-width: 32rem;
}

@media (min-width: 1280px) {
    section.bg-blueGray-50 .max-w-lg {
        max-width: 38rem;
    }
}

/* Gradient background less intense */
section.bg-blueGray-50 > img.opacity-30 {
    opacity: 0.15;
}

/* ========================================
   FOOTER MIGLIORAMENTI
   ======================================== */

/* Footer social spacing */
footer .p-4 {
    padding: 0.75rem;
}

/* Footer text mobile */
@media (max-width: 640px) {
    footer .text-sm {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
}

/* ========================================
   CARDS E FEATURE SECTIONS
   ======================================== */

/* Feature card hover */
.bg-gray-50.hover\:bg-gray-100 {
    transition: all 300ms ease;
}

.bg-gray-50.hover\:bg-gray-100:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Feature images */
.w-72.h-72.object-cover {
    object-fit: contain;
}

/* ========================================
   TESTIMONIALS
   ======================================== */

/* Testimonial cards hover */
.testimonial-card {
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* ========================================
   ACCESSIBILITA
   ======================================== */

/* 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) {
    .text-gray-600 {
        color: #374151;
    }

    .text-gray-500 {
        color: #4b5563;
    }
}

/* ========================================
   FEATURE SECTIONS - LAYOUT COMPATTO
   ======================================== */

/* Riduci padding verticale sezioni feature */
section.py-20.md\:py-28.bg-blueGray-50.overflow-hidden,
section.py-20.md\:py-28.bg-white.overflow-hidden {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

@media (min-width: 768px) {
    section.py-20.md\:py-28.bg-blueGray-50.overflow-hidden,
    section.py-20.md\:py-28.bg-white.overflow-hidden {
        padding-top: 5rem !important;
        padding-bottom: 5rem !important;
    }
}

/* Immagini feature più grandi */
section.overflow-hidden .max-w-lg {
    max-width: 100% !important;
}

/* Testo feature più largo */
section.overflow-hidden .md\:max-w-md {
    max-width: 100% !important;
}

@media (min-width: 1024px) {
    section.overflow-hidden .md\:max-w-md {
        max-width: 90% !important;
    }
}

/* Riduci gap tra colonne */
section.overflow-hidden .flex-wrap.items-center.-mx-4 {
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
}

section.overflow-hidden .flex-wrap.items-center.-mx-4 > .px-4 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

@media (min-width: 1024px) {
    section.overflow-hidden .flex-wrap.items-center.-mx-4 {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        gap: 0;
    }
    
    section.overflow-hidden .flex-wrap.items-center.-mx-4 > .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Margini titoli e paragrafi più compatti */
section.overflow-hidden h2.mb-6 {
    margin-bottom: 1rem !important;
}

section.overflow-hidden p.mb-8 {
    margin-bottom: 1.5rem !important;
}

section.overflow-hidden span.mb-5 {
    margin-bottom: 0.75rem !important;
}

/* Mobile: riduci spazio sotto immagine */
@media (max-width: 1023px) {
    section.overflow-hidden .mb-12.lg\:mb-0 {
        margin-bottom: 2rem !important;
    }
}

/* ========================================
   PROSE TYPOGRAPHY - BLOG ARTICLES
   ======================================== */

.prose {
    color: #374151;
    max-width: 65ch;
    line-height: 1.75;
}

.prose.max-w-none {
    max-width: none;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    line-height: 1.8;
}

.prose p:first-child {
    margin-top: 0;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose h2 {
    color: #111827;
    font-weight: 700;
    font-size: 1.5em;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3333333;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5em;
}

.prose h3 {
    color: #111827;
    font-weight: 600;
    font-size: 1.25em;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.6;
}

.prose h4 {
    color: #111827;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.prose strong {
    color: #111827;
    font-weight: 600;
}

.prose em {
    font-style: italic;
}

.prose a {
    color: #4f46e5;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #4338ca;
}

.prose ul {
    list-style-type: disc;
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose ol {
    list-style-type: decimal;
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 0.375em;
}

.prose li::marker {
    color: #6b7280;
}

.prose blockquote {
    font-weight: 500;
    font-style: italic;
    color: #111827;
    border-left: 4px solid #e5e7eb;
    margin-top: 1.6em;
    margin-bottom: 1.6em;
    padding-left: 1em;
    background-color: #f9fafb;
    padding: 1em;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose code {
    color: #111827;
    font-weight: 600;
    font-size: 0.875em;
    background-color: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
}

.prose pre {
    color: #e5e7eb;
    background-color: #1f2937;
    overflow-x: auto;
    font-size: 0.875em;
    line-height: 1.7142857;
    margin-top: 1.7142857em;
    margin-bottom: 1.7142857em;
    border-radius: 0.375rem;
    padding: 0.8571429em 1.1428571em;
}

.prose pre code {
    background-color: transparent;
    border-width: 0;
    border-radius: 0;
    padding: 0;
    font-weight: inherit;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

.prose hr {
    border-color: #e5e7eb;
    border-top-width: 1px;
    margin-top: 3em;
    margin-bottom: 3em;
}

.prose img {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 0.5rem;
}

.prose figure {
    margin-top: 2em;
    margin-bottom: 2em;
}

.prose figcaption {
    color: #6b7280;
    font-size: 0.875em;
    line-height: 1.4285714;
    margin-top: 0.8571429em;
}

.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.875em;
    line-height: 1.7142857;
}

.prose thead {
    border-bottom-width: 1px;
    border-bottom-color: #d1d5db;
}

.prose thead th {
    color: #111827;
    font-weight: 600;
    vertical-align: bottom;
    padding-right: 0.5714286em;
    padding-bottom: 0.5714286em;
    padding-left: 0.5714286em;
}

.prose tbody tr {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.prose tbody td {
    vertical-align: baseline;
    padding: 0.5714286em;
}

/* Prose Large variant */
.prose-lg {
    font-size: 1.125rem;
    line-height: 1.7777778;
}

.prose-lg p {
    margin-top: 1.3333333em;
    margin-bottom: 1.3333333em;
}

.prose-lg h2 {
    font-size: 1.6666667em;
    margin-top: 1.8666667em;
    margin-bottom: 1.0666667em;
    line-height: 1.3333333;
}

.prose-lg h3 {
    font-size: 1.3333333em;
    margin-top: 1.6666667em;
    margin-bottom: 0.6666667em;
    line-height: 1.5;
}

.prose-lg ul, .prose-lg ol {
    margin-top: 1.3333333em;
    margin-bottom: 1.3333333em;
    padding-left: 1.5555556em;
}

.prose-lg li {
    margin-top: 0.6666667em;
    margin-bottom: 0.6666667em;
}

/* Prose mobile responsive */
@media (max-width: 640px) {
    .prose {
        font-size: 1rem;
    }

    .prose h2 {
        font-size: 1.375em;
        margin-top: 1.5em;
    }

    .prose h3 {
        font-size: 1.125em;
    }

    .prose-lg {
        font-size: 1rem;
    }
}
