/* ================================
   CODESONA - TABLET RESPONSIVE FIX
   ALL TABLETS: iPad, Surface Pro, Galaxy Tab, etc.
   Portrait Mode Optimization Priority
   Expert Front-End Design by Codesona Team
   ================================ */

/* ================================
   TABLET DEVICES SUPPORTED
   - iPad Mini, Air, Pro (All models)
   - Microsoft Surface Pro (7, 8, 9, X)
   - Samsung Galaxy Tab S series
   - Android tablets (768px+)
   - Windows tablets
   
   KEY INSIGHT: Portrait mode problematic, Landscape OK
   ================================ */

/* ================================
   BASE CONTAINER - ALL TABLETS
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 32px;
    }
}

/* ================================
   DESKTOP - HIDE HAMBURGER
   ================================ */
@media (min-width: 1025px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* ================================
   CRITICAL: TABLET PORTRAIT MODE FIX
   Primary problem area - Optimize vertical space
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* Hero - Reduce vertical spacing */
    .hero {
        padding: calc(var(--navbar-height) + 48px) 0 48px;
        min-height: auto;
    }
    
    .hero-content {
        max-width: 85%;
    }
    
    /* Badge - Smaller */
    .hero .badge {
        margin-bottom: 16px;
        font-size: 13px;
        padding: 6px 14px;
        height: 32px;
    }
    
    /* Title - Compact but readable */
    .hero-title {
        font-size: clamp(36px, 5.5vw, 48px);
        line-height: 1.1;
        margin-bottom: 16px;
        letter-spacing: -0.025em;
    }
    
    /* Subtitle - Compact */
    .hero-subtitle {
        font-size: 15px;
        line-height: 1.55;
        margin-bottom: 24px;
        max-width: 560px;
    }
    
    /* Hide line breaks for better flow */
    .hero-subtitle br {
        display: none;
    }
    
    /* CTA Buttons - Stack vertically in portrait */
    .hero-ctas {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 32px;
        max-width: 420px;
    }
    
    .btn-hero,
    .btn-ghost {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        min-height: 50px;
        font-size: 15px;
    }
    
    /* Trust section - Compact */
    .hero-trust {
        margin-bottom: 32px;
    }
    
    .trust-label {
        margin-bottom: 12px;
        font-size: 11px;
    }
    
    /* IDE Badges - Smaller in portrait */
    .hero-ide-badges {
        gap: 8px;
        max-width: 100%;
    }
    
    .ide-badge {
        height: 34px;
        padding: 0 12px;
        font-size: 13px;
    }
    
    .ide-badge svg {
        width: 14px;
        height: 14px;
    }
    
    /* Stats - Stack vertically in portrait */
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 400px;
        margin: 28px auto 32px;
        padding: 0;
    }
    
    .stat-item {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
    
    /* Remove vertical dividers */
    .stat-item:not(:last-child)::after {
        display: none;
    }
    
    .stat-value {
        font-size: 26px;
        margin-bottom: 6px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    /* Code mockup - Compact */
    .code-mockup {
        margin-top: 32px;
        max-width: 100%;
    }
    
    .mockup-header {
        padding: 12px 14px;
    }
    
    .mockup-content {
        padding: 16px;
        font-size: 12px;
        line-height: 1.5;
    }
    
    .ai-suggestion {
        padding: 16px;
        margin-top: 16px;
    }
    
    .ai-header {
        margin-bottom: 10px;
    }
    
    .ai-text {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .code-line {
        margin-bottom: 2px;
    }
}

/* ================================
   SURFACE PRO 7 SPECIFIC (2736x1824 = 768px@150% DPI)
   ================================ */
@media (min-width: 768px) and (max-width: 912px) and (orientation: portrait) {
    .container {
        padding: 0 28px;
    }
    
    .hero-title {
        font-size: 42px;
    }
    
    .hero-subtitle {
        font-size: 15px;
    }
    
    .hero-ctas {
        max-width: 400px;
    }
    
    /* Reduce all section padding for better vertical fit */
    section {
        padding: 56px 0;
    }
    
    .features,
    .pricing,
    .faq,
    .cta-section {
        padding: 56px 0;
    }
}

/* ================================
   TABLET LANDSCAPE - Keep as-is (Working fine)
   ================================ */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    /* Landscape mode works fine - minimal adjustments */
    .hero {
        min-height: auto;
        padding: calc(var(--navbar-height) + 64px) 0 64px;
    }
    
    .hero-ctas {
        flex-direction: row;
        margin-bottom: 40px;
    }
    
    .btn-hero {
        min-width: 220px;
        max-width: 280px;
    }
    
    .btn-ghost {
        min-width: 160px;
        max-width: 200px;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        margin: 40px auto 52px;
    }
    
    .code-mockup {
        margin-top: 48px;
    }
}

/* ================================
   FEATURES SECTION - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .features {
        padding: 56px 0;
    }
    
    .section-header {
        margin-bottom: 36px;
    }
    
    .section-title {
        font-size: 32px;
        margin-bottom: 12px;
    }
    
    .section-subtitle {
        font-size: 15px;
        line-height: 1.6;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }
    
    .feature-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .feature-description {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* Features - Landscape OK */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .features {
        padding: 72px 0;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* ================================
   PRICING SECTION - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .pricing {
        padding: 56px 0;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 460px;
        margin: 0 auto;
    }
    
    .pricing-card {
        padding: 28px 24px;
    }
    
    .pricing-card.featured {
        transform: scale(1);
        border: 2px solid rgba(59, 130, 246, 0.5);
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2);
    }
    
    .plan-name {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .plan-price {
        font-size: 36px;
        margin-bottom: 6px;
    }
    
    .plan-description {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .plan-features {
        margin-bottom: 24px;
    }
    
    .plan-feature {
        font-size: 14px;
        padding: 8px 0;
    }
}

/* Pricing - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .pricing {
        padding: 72px 0;
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        max-width: 800px;
    }
}

/* ================================
   FAQ SECTION - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .faq {
        padding: 56px 0;
    }
    
    .faq-list {
        max-width: 100%;
    }
    
    .faq-item {
        padding: 20px;
    }
    
    .faq-question {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .faq-answer {
        font-size: 14px;
        line-height: 1.6;
        margin-top: 12px;
    }
}

/* FAQ - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .faq {
        padding: 72px 0;
    }
    
    .faq-list {
        max-width: 700px;
    }
}

/* ================================
   CTA SECTION - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .cta-section {
        padding: 56px 0;
    }
    
    .cta-content {
        max-width: 100%;
        padding: 36px 28px;
    }
    
    .cta-title {
        font-size: 30px;
        margin-bottom: 16px;
        line-height: 1.2;
    }
    
    .cta-description {
        font-size: 15px;
        margin-bottom: 24px;
        line-height: 1.6;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .cta-buttons .btn-primary,
    .cta-buttons .btn-ghost {
        min-height: 50px;
        padding: 14px 24px;
        font-size: 15px;
        width: 100%;
    }
}

/* CTA - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .cta-section {
        padding: 72px 0;
    }
    
    .cta-buttons {
        flex-direction: row;
        gap: 16px;
    }
}

/* ================================
   BREADCRUMBS - TABLET FIX (NUCLEAR OPTION)
   Force single line - NO WRAPPING ALLOWED
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .breadcrumbs-wrapper {
        padding-top: calc(64px + 16px) !important;
        padding-bottom: 12px !important;
        overflow: visible !important;
        width: 100% !important;
        position: relative !important;
    }
    
    /* Promo banner olan sayfalarda ekstra padding */
    body:has(.promo-banner) .breadcrumbs-wrapper {
        padding-top: calc(64px + 16px + var(--promo-banner-height) + 16px) !important;
    }
    
    .breadcrumbs-wrapper .container {
        overflow: visible !important;
        padding: 0 20px !important;
    }
    
    .breadcrumbs {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
        list-style: none !important;
        overflow: visible !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }
    
    .breadcrumbs * {
        box-sizing: border-box !important;
    }
    
    .breadcrumbs a {
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
    }
    
    .breadcrumbs span:not(.breadcrumb-separator) {
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
    }
    
    .breadcrumb-separator {
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        margin: 0 6px !important;
        padding: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
        float: none !important;
    }
    
    /* Kill any inherited styles that might cause wrapping */
    .breadcrumbs br {
        display: none !important;
    }
    
    .breadcrumbs::before,
    .breadcrumbs::after {
        display: none !important;
    }
}


/* ================================
   NAVBAR - TABLET PORTRAIT (HAMBURGER)
   Use mobile menu on portrait mode
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .navbar {
        padding: 0 20px !important;
        height: 64px !important;
    }
    
    .nav-content {
        height: 64px !important;
    }
    
    .logo {
        font-size: 18px !important;
    }
    
    .logo svg {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Hide desktop menu on portrait */
    .nav-menu {
        display: none !important;
    }
    
    /* Hide nav actions buttons on portrait */
    .nav-actions .btn {
        display: none !important;
    }
    
    /* Show hamburger menu on portrait */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 8px;
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    /* Mobile Menu Overlay - Tablet Portrait Fix */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: rgb(10, 10, 15);
        backdrop-filter: blur(20px);
        overflow: hidden;
        overscroll-behavior: contain;
    }
    
    /* Mobile Menu Content - Tablet Portrait Fix */
    .mobile-menu-content {
        position: fixed;
        top: 2px;
        left: 0;
        width: 100%;
        height: calc(100vh - 2px);
        height: calc(100dvh - 2px);
        padding: 16px 20px 0;
        overflow-y: hidden;
        display: flex;
        flex-direction: column;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    
    /* Mobile Menu Header - No shrink */
    .mobile-menu-header {
        flex-shrink: 0;
    }
    
    /* Mobile Nav Section - Scrollable if needed */
    .mobile-nav-section {
        padding: 8px 0 12px;
        flex: 1 1 auto;
        overflow-y: auto;
        min-height: 0;
    }
    
    /* Mobile Nav Actions - Fixed at bottom */
    .mobile-nav-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: auto;
        padding: 16px 0 20px;
        flex-shrink: 0;
    }
}

/* ================================
   NAVBAR - TABLET LANDSCAPE (DESKTOP-LIKE)
   Keep normal menu on landscape mode
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .navbar {
        padding: 0 24px !important;
        height: 72px !important;
    }
    
    .nav-content {
        height: 72px !important;
        gap: 16px !important;
    }
    
    .logo {
        font-size: 18px !important;
    }
    
    .logo svg {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Show menu on landscape */
    .nav-menu {
        display: flex !important;
        gap: 16px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none !important;
    }
    
    .nav-link {
        font-size: 14px !important;
        padding: 8px 12px !important;
        white-space: nowrap !important;
    }
    
    .nav-link svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Show nav actions on landscape */
    .nav-actions {
        display: flex !important;
        gap: 12px !important;
    }
    
    .nav-actions .btn {
        display: inline-flex !important;
        padding: 8px 16px !important;
        font-size: 14px !important;
        min-height: 40px !important;
    }
    
    /* Hide hamburger on landscape */
    .mobile-menu-toggle {
        display: none !important;
    }
}


/* ================================
   FOOTER - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .footer {
        padding: 48px 0 28px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
    
    .footer-column:first-child {
        grid-column: 1 / -1;
        margin-bottom: 12px;
    }
    
    .footer-heading {
        font-size: 14px;
        margin-bottom: 14px;
    }
    
    .footer-links {
        gap: 8px;
    }
    
    .footer-links a {
        font-size: 13px;
        padding: 6px 0;
    }
    
    .footer-bottom {
        margin-top: 32px;
        padding-top: 20px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-copyright {
        font-size: 12px;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* Footer - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .footer {
        padding: 60px 0 32px;
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

/* ================================
   INTEGRATIONS PAGE - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .integrations-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .integration-card {
        padding: 24px;
    }
    
    .integration-icon {
        width: 48px;
        height: 48px;
    }
    
    .integration-name {
        font-size: 18px;
    }
    
    .integration-description {
        font-size: 14px;
    }
}

/* Integrations - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .integrations-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* ================================
   FEATURES PAGE - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .feature-showcase {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 0;
    }
    
    .feature-visual {
        order: 2;
    }
    
    .feature-details {
        order: 1;
    }
    
    .feature-showcase-title {
        font-size: 28px;
        margin-bottom: 14px;
    }
    
    .feature-showcase-description {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* Features page - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .feature-showcase {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

/* ================================
   FORMS & INPUTS - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .form-container {
        max-width: 100%;
        padding: 32px 28px;
    }
    
    .form-input,
    .form-textarea {
        font-size: 16px;
        padding: 13px 15px;
        min-height: 48px;
    }
    
    .form-button {
        height: 50px;
        font-size: 15px;
        width: 100%;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

/* Forms - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .form-container {
        max-width: 520px;
        padding: 40px 36px;
    }
}

/* ================================
   MODALS & OVERLAYS - TABLET PORTRAIT
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .modal-content {
        max-width: 90%;
        padding: 28px;
    }
    
    .modal-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .modal-body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
    }
}

/* Modals - Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .modal-content {
        max-width: 600px;
        padding: 36px;
    }
}

/* ================================
   CARDS & COMPONENTS - ALL TABLETS
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .card {
        padding: 24px;
        border-radius: 14px;
    }
    
    .card-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .card-description {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .badge {
        font-size: 13px;
        padding: 6px 13px;
        height: 30px;
    }
}

/* ================================
   PERFORMANCE OPTIMIZATION
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Reduce animations for better performance on tablets */
    * {
        animation-duration: 0.4s !important;
    }
    
    /* Optimize transforms */
    .btn-hero,
    .btn-ghost,
    .feature-card,
    .pricing-card {
        will-change: transform;
        transform: translateZ(0);
    }
}

/* ================================
   TOUCH OPTIMIZATION FOR TABLETS
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Larger touch targets */
    button,
    a,
    .btn {
        min-height: 44px;
    }
    
    /* Remove hover states for touch devices */
    @media (hover: none) {
        .btn-hero:hover,
        .btn-ghost:hover,
        .feature-card:hover,
        .pricing-card:hover {
            transform: none;
        }
        
        .btn-hero:active,
        .btn-ghost:active {
            transform: scale(0.97);
        }
    }
}

/* ================================
   ACCESSIBILITY - TABLET
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Ensure readable text sizes */
    body {
        font-size: 16px;
    }
    
    /* Focus indicators */
    *:focus-visible {
        outline: 3px solid rgba(59, 130, 246, 0.6);
        outline-offset: 2px;
    }
    
    /* Minimum contrast */
    .text-secondary {
        color: rgba(255, 255, 255, 0.75);
    }
    
    .text-tertiary {
        color: rgba(255, 255, 255, 0.65);
    }
}

/* ================================
   SAFE AREA INSETS (for modern iPads)
   ================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    @supports (padding: max(0px)) {
        .hero,
        .features,
        .pricing,
        .cta-section {
            padding-left: max(32px, env(safe-area-inset-left));
            padding-right: max(32px, env(safe-area-inset-right));
        }
        
        .navbar {
            padding-left: max(32px, env(safe-area-inset-left));
            padding-right: max(32px, env(safe-area-inset-right));
        }
    }
}

