/* ==========================================
   ROIATEK AI - Responsive CSS
   Mobile-First Responsive Design
   ========================================== */

/* ---------- Tablet Landscape (1024px and below) ---------- */
@media (max-width: 1024px) {
    :root {
        --header-height: 70px;
    }
    
    /* Prevent horizontal overflow */
    body, html {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    section {
        overflow-x: hidden;
    }
    
    /* Hero */
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-description {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .service-card-wide {
        grid-column: span 2;
        grid-template-columns: 1fr;
    }
    
    /* About Grid */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3xl);
    }
    
    .about-content .section-title {
        text-align: center;
    }
    
    .about-content {
        text-align: center;
    }
    
    .about-features {
        justify-items: center;
    }
    
    .about-feature {
        text-align: left;
    }
    
    .about-visual {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Solutions */
    .solution-panel {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }
    
    .solution-image {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .solution-info {
        text-align: center;
    }
    
    .solution-list li {
        justify-content: center;
    }
    
    .solution-info .btn {
        display: inline-flex;
    }
    
    /* Why Us */
    .why-us-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3xl);
    }
    
    .why-us-content .section-title,
    .why-us-content .section-description {
        text-align: center;
    }
    
    .advantage-list {
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-card.featured {
        grid-column: span 2;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Testimonials */
    .testimonial-card {
        flex: 0 0 calc(50% - var(--space-xl) / 2);
        min-width: calc(50% - var(--space-xl) / 2);
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3xl);
    }
    
    .contact-info .section-title {
        text-align: center;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-details {
        align-items: center;
    }
    
    .contact-item {
        max-width: 350px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2xl);
    }
    
    .footer-brand {
        grid-column: span 2;
        text-align: center;
    }
    
    .footer-description {
        max-width: 100%;
        margin: 0 auto var(--space-xl);
    }
    
    .footer-brand .social-links {
        justify-content: center;
    }
}

/* ---------- Tablet Portrait (768px and below) ---------- */
@media (max-width: 768px) {
    :root {
        --space-4xl: 4rem;
        --space-5xl: 5rem;
    }
    
    /* Critical overflow fixes */
    * {
        box-sizing: border-box;
    }
    
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw;
        width: 100%;
    }
    
    body {
        background-attachment: scroll !important;
    }
    
    section, .container, main {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    /* Background images - make visible on mobile */
    .hero .hero-image-overlay,
    .events-gallery .hero-image-overlay,
    .solutions .hero-image-overlay {
        background-attachment: scroll !important;
        background-size: cover !important;
        opacity: 0.8 !important;
    }
    
    .hero .hero-image-overlay {
        width: 90%;
        right: -5%;
        background-position: center right !important;
    }
    
    .events-gallery .hero-image-overlay,
    .solutions .hero-image-overlay {
        width: 90%;
        left: -5%;
        background-position: center left !important;
    }
    
    .services::before {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center bottom !important;
        opacity: 0.7 !important;
    }
    
    /* Navigation */
    /* Header always visible on mobile - force background in all states */
    .header,
    .header.scrolled {
        background-color: rgba(10, 10, 15, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3) !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-xl);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        font-size: 1.5rem;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-actions .btn {
        display: none;
    }
    
    /* Hero */
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-lg);
    }
    
    .stat-divider {
        display: none;
    }
    
    .stat-item {
        flex: 1;
        min-width: 140px;
    }
    
    .hero-scroll {
        display: none;
    }
    
    /* Section Styles */
    .section-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card-wide {
        grid-column: span 1;
    }
    
    /* About Features */
    .about-features {
        grid-template-columns: 1fr;
    }
    
    /* Solutions Tabs */
    .solutions-tabs {
        gap: var(--space-xs);
    }
    
    .tab-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    /* Metrics Grid */
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-card.featured {
        grid-column: span 1;
        transform: none;
        max-width: 100%;
    }
    
    .pricing-card.featured:hover {
        transform: translateY(-8px);
    }
    
    /* Testimonials */
    .testimonial-card {
        flex: 0 0 100%;
        min-width: 100%;
    }
    
    /* Partners */
    .partners-track {
        gap: var(--space-lg);
    }
    
    .partner-logo {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }
    
    /* Contact Form */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .footer-links ul {
        align-items: center;
    }
    
    .newsletter-form {
        max-width: 320px;
        margin: 0 auto;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-md);
    }
}

/* ---------- Mobile (480px and below) ---------- */
@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
        --space-3xl: 3rem;
        --space-4xl: 3.5rem;
        --space-5xl: 4rem;
    }
    
    /* Typography */
    .hero-title {
        font-size: 1.875rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-description,
    .section-description {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Stats */
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-suffix {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Service Cards */
    .service-card {
        padding: var(--space-xl);
    }
    
    .service-title {
        font-size: 1.25rem;
    }
    
    .service-number {
        font-size: 2rem;
    }
    
    /* About */
    .about-stats-card {
        padding: var(--space-md);
        bottom: -10px;
        left: -10px;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .about-badge-card {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.75rem;
        top: -5px;
        right: -5px;
    }
    
    /* Metrics */
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        padding: var(--space-xl);
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    /* Pricing */
    .pricing-card {
        padding: var(--space-xl);
    }
    
    .price {
        font-size: 3rem;
    }
    
    .price-custom {
        font-size: 2rem;
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: var(--space-xl);
    }
    
    .testimonial-content p {
        font-size: 1rem;
    }
    
    /* Contact */
    .contact-form-wrapper {
        padding: var(--space-xl);
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
    }
    
    /* CTA */
    .cta-title {
        font-size: 1.5rem;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-actions .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Footer */
    .footer {
        padding: var(--space-3xl) 0 var(--space-lg);
        margin-bottom: 0 !important;
    }
    
    .footer-grid {
        gap: var(--space-xl);
        width: 100%;
        overflow: hidden;
    }
    
    .footer-bottom {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Prevent grid overflow */
    .products-grid,
    .services-grid,
    .events-grid-wrapper,
    .solutions-grid {
        width: 100%;
        overflow: hidden;
        grid-template-columns: 1fr;
    }
    
    /* Cards full width on mobile */
    .product-card,
    .service-card,
    .solution-card {
        width: 100%;
        max-width: 100%;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* ---------- Small Mobile (360px and below) ---------- */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.625rem;
    }
    
    .section-title {
        font-size: 1.375rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-md);
    }
    
    .stat-item {
        min-width: 100px;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .tab-btn {
        padding: var(--space-sm);
        font-size: 0.75rem;
    }
    
    .partner-logo {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.75rem;
    }
}

/* ---------- Landscape Mode Adjustments ---------- */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-description {
        margin-bottom: var(--space-lg);
    }
    
    .hero-actions {
        margin-bottom: var(--space-xl);
    }
    
    .hero-stats {
        gap: var(--space-lg);
    }
}

/* ---------- High DPI Displays ---------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-grid {
        background-size: 100px 100px;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .header,
    .preloader,
    .cursor,
    .cursor-follower,
    .back-to-top,
    .hero-visual,
    .hero-scroll,
    .slider-controls {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .text-gradient {
        background: none;
        -webkit-text-fill-color: black;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
    
    .btn {
        border: 1px solid black;
        background: none;
        color: black;
    }
}