/* ============================================
   MOBILE RESPONSIVE STYLES FOR ALL PAGES
   ============================================ */

/* Hide mobile menu toggle by default (desktop) */
.mobile-menu-toggle {
    display: none;
}

/* Mobile Navigation */
@media (max-width: 768px) {

    /* Container Padding */
    .container {
        padding: 0 1rem !important;
    }

    /* Fix hero navigation background on mobile */
    .hero-nav {
        background: rgba(121, 64, 254, 0.98) !important;
        backdrop-filter: blur(10px);
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    /* Navigation content positioning */
    .nav-content {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 0;
    }

    /* Navigation Menu - Hamburger Menu */
    .nav-menu {
        display: none;
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: linear-gradient(180deg, #4CE7E4 0%, #20A3A2 70%, #1A7B7A 100%);
        padding: 1rem;
        gap: 0.25rem !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        z-index: 999;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .nav-menu.active {
        display: flex;
        max-height: 400px;
        padding: 1rem;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .nav-link {
        display: block;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: 6px;
        transition: background 0.2s ease;
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    /* Mobile Menu Toggle Button */
    .mobile-menu-toggle {
        display: block !important;
        position: relative;
        background: none;
        border: none;
        color: white;
        font-size: 1.75rem;
        cursor: pointer;
        padding: 0.5rem;
        line-height: 1;
        z-index: 1001;
        transition: transform 0.2s ease;
    }

    .mobile-menu-toggle:hover {
        transform: scale(1.1);
    }

    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }

    /* Hero Section */
    .hero-section {
        min-height: auto !important;
    }

    .hero-title {
        font-size: 1.75rem !important;
        padding: 0 0.5rem;
    }

    .hero-input-wrapper {
        padding: 0 0.5rem;
    }

    .hero-input-group {
        flex-direction: column;
    }

    .hero-input {
        border-radius: 8px 8px 0 0 !important;
        font-size: 0.95rem;
    }

    .hero-btn {
        border-radius: 0 0 8px 8px !important;
        padding: 0.875rem 1rem;
    }

    /* Video Editor Layout */
    .video-editor {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .main-container {
        padding: 1rem !important;
    }

    /* Format and Quality Row */
    .format-quality-row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    /* Tabs */
    .tabs {
        flex-direction: row;
    }

    .tab {
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem;
    }

    /* Time Inputs */
    .time-row {
        gap: 0.5rem !important;
    }

    .time-input-small {
        font-size: 0.85rem;
    }

    /* Action Buttons */
    .action-row {
        flex-direction: column;
    }

    .action-row button {
        width: 100%;
    }

    /* Range Slider Labels */
    .range-slider-label {
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem 1rem;
    }

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

    .feature-description {
        font-size: 0.85rem;
    }

    /* FAQ Section */
    .faq-container {
        padding: 1rem;
    }

    .faq-question {
        font-size: 0.9rem;
        padding: 1rem 0;
    }

    .faq-answer p {
        font-size: 0.85rem;
    }

    /* Footer Grid */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-logo {
        margin: 0 auto 1rem;
    }

    .footer-nav {
        align-items: center;
    }

    /* CTA Section */
    .cta-title {
        font-size: 1.5rem !important;
        padding: 2.5rem 1.5rem !important;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.75rem !important;
        padding: 0 1rem;
    }

    /* Cards and Content Sections */
    .card {
        padding: 1rem !important;
    }

    /* About Page - Grid Layouts */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Contact Page - Contact Grid */
    section div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* How To Use - Steps Grid */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Video Player Section */
    .video-player-section {
        margin-bottom: 1rem;
    }

    .video-placeholder {
        min-height: 200px;
    }

    /* Format Dropdown */
    .format-dropdown {
        max-height: 200px;
    }

    /* Progress Section */
    .progress-info {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }

    /* Download Link */
    #downloadLink {
        width: 100%;
        text-align: center;
    }

    /* Reset Button */
    #resetBtn {
        width: 100%;
    }

    /* Video Upload Section Fixes */
    #localUploadSection {
        width: 100%;
        overflow-x: hidden;
    }

    #localUploadSection .video-placeholder {
        min-height: 180px;
        width: 100%;
    }

    #localUploadSection video {
        width: 100%;
        height: auto;
        max-height: 250px;
    }

    /* Video title/filename text wrapping */
    #localUploadSection h3,
    #localUploadSection p {
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        white-space: normal;
    }

    /* Clip cards - Compact mobile design */
    #localUploadSection .clip-item {
        padding: 0.875rem !important;
        margin-bottom: 0.875rem !important;
        position: relative;
        border-radius: 12px !important;
    }

    #localUploadSection .clip-item h4 {
        font-size: 0.95rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Remove button - Better mobile styling */
    #localUploadSection .remove-clip {
        position: absolute !important;
        top: 0.75rem !important;
        right: 0.75rem !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.1rem !important;
        line-height: 1 !important;
        background: rgba(220, 38, 38, 0.1) !important;
        color: #dc2626 !important;
        border: 1px solid rgba(220, 38, 38, 0.3) !important;
    }

    #localUploadSection .remove-clip:hover {
        background: #dc2626 !important;
        color: white !important;
    }

    /* Time inputs compact */
    #localUploadSection .time-input-small {
        font-size: 0.9rem !important;
        padding: 0.6rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Labels */
    #localUploadSection label {
        font-size: 0.85rem !important;
        margin-bottom: 0.35rem !important;
    }

    /* Action buttons */
    #localUploadSection button {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Range slider */
    #localUploadSection input[type="range"] {
        width: 100%;
        margin: 0.5rem 0 !important;
    }

    /* Range slider label */
    #localUploadSection .range-slider-label {
        font-size: 0.75rem !important;
        padding: 0.15rem 0.4rem !important;
    }
}

/* Tablet Responsiveness (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .video-editor {
        grid-template-columns: 1fr !important;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero-title {
        font-size: 2rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem !important;
    }

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

    .nav-link {
        font-size: 0.9rem;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }

    .cta-title {
        font-size: 1.25rem !important;
    }

    /* Reduce padding on small screens */
    section[style*="padding: 4rem 0"] {
        padding: 2rem 0 !important;
    }

    .time-section {
        padding: 0.75rem;
    }

    .clip-item {
        padding: 0.5rem;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto !important;
    }

    .hero-content {
        padding: 1.5rem 1rem !important;
    }

    .video-player-section {
        max-height: 300px;
    }
}

/* Print Styles */
@media print {

    .hero-nav,
    .footer-enhanced,
    .cta-section,
    .video-editor {
        display: none;
    }
}

/* Fix for inline styles on mobile - these override inline styles when needed */
@media (max-width: 768px) {

    /* About page grids */
    section>div>div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }

    /* Padding overrides */
    section[style*="padding: 4rem 0"] {
        padding: 2.5rem 0 !important;
    }

    /* Contact page cards */
    div[style*="background: #f5f3ff; padding: 2rem"] {
        padding: 1.5rem !important;
    }

    /* How to use numbered circles */
    div[style*="width: 48px; height: 48px"] {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
    }

    /* Max width containers */
    div[style*="max-width: 900px"],
    div[style*="max-width: 800px"] {
        padding: 0 1rem;
    }

    /* Text sizes */
    h2[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }

    h3[style*="font-size: 1.25rem"] {
        font-size: 1.1rem !important;
    }
}

/* Accessibility - Larger touch targets on mobile */
@media (max-width: 768px) {

    button,
    a,
    .btn,
    .tab,
    .format-option {
        min-height: 44px;
        min-width: 44px;
    }

    /* Increase spacing for better touch interaction */
    .nav-menu li {
        margin: 0.25rem 0;
    }
}

/* ============================================
   MOBILE L - 525px BREAKPOINT
   ============================================ */
@media (max-width: 525px) {
    .hero-title {
        font-size: 1.6rem !important;
        line-height: 1.3;
        padding: 0 0.75rem;
    }

    .hero-input {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .hero-btn {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.6rem !important;
    }

    .feature-card {
        padding: 1.25rem;
    }

    .feature-icon {
        width: 52px;
        height: 52px;
    }

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

    .feature-description {
        font-size: 0.875rem;
    }

    /* Grid fixes */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    /* Padding adjustments */
    section[style*="padding: 4rem 0"] {
        padding: 2.5rem 0 !important;
    }

    .container {
        padding: 0 1rem !important;
    }

    /* Video editor improvements */
    .local-upload-layout {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Button improvements */
    .btn {
        font-size: 0.9rem;
        padding: 0.8rem 1.25rem;
    }
}

/* ============================================
   MOBILE M - 375px BREAKPOINT
   ============================================ */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.4rem !important;
        line-height: 1.25;
        padding: 0 0.5rem;
    }

    .hero-input-wrapper {
        padding: 0 0.25rem;
    }

    .hero-input {
        font-size: 0.85rem;
        padding: 0.7rem;
    }

    .hero-btn {
        padding: 0.75rem 0.9rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.4rem !important;
        padding: 0 0.5rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
    }

    .feature-title {
        font-size: 0.95rem;
    }

    .feature-description {
        font-size: 0.825rem;
        line-height: 1.5;
    }

    /* Grid spacing */
    div[style*="grid-template-columns"] {
        gap: 1rem !important;
    }

    /* Text adjustments */
    h2[style*="font-size: 2rem"] {
        font-size: 1.35rem !important;
    }

    h3[style*="font-size: 1.25rem"] {
        font-size: 1rem !important;
    }

    p[style*="line-height: 1.8"] {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }

    /* Padding adjustments */
    section[style*="padding: 4rem 0"] {
        padding: 2rem 0 !important;
    }

    div[style*="padding: 1.5rem"] {
        padding: 1rem !important;
    }

    .container {
        padding: 0 0.875rem !important;
    }

    /* CTA improvements */
    .cta-title {
        font-size: 1.15rem !important;
        padding: 2rem 1rem !important;
    }

    /* Button improvements */
    .btn {
        font-size: 0.875rem;
        padding: 0.75rem 1.1rem;
    }

    /* Upload button text */
    #localUploadToggle {
        font-size: 0.85rem !important;
        padding: 0.8rem 1rem !important;
    }

    /* Nav improvements */
    .nav-link {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }

    .logo-img {
        height: 32px;
    }

    /* Footer */
    .footer-logo {
        height: 55px !important;
    }

    .footer-heading {
        font-size: 1rem;
    }

    .footer-link,
    .footer-text {
        font-size: 0.85rem;
    }

    /* Video upload improvements */
    #localUploadSection h3 {
        font-size: 0.9rem !important;
        line-height: 1.3;
    }

    #localUploadSection .video-placeholder {
        min-height: 160px;
    }

    #localUploadSection video {
        max-height: 200px;
    }

    /* Compact clip cards */
    #localUploadSection .clip-item {
        padding: 0.75rem !important;
    }

    #localUploadSection .clip-item h4 {
        font-size: 0.9rem !important;
        margin-bottom: 0.65rem !important;
    }

    #localUploadSection .remove-clip {
        top: 0.65rem !important;
        right: 0.65rem !important;
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        font-size: 1rem !important;
    }

    #localUploadSection .time-input-small {
        font-size: 0.85rem !important;
        padding: 0.55rem !important;
    }

    #localUploadSection label {
        font-size: 0.8rem !important;
    }
}

/* ============================================
   MOBILE S - 320px BREAKPOINT
   ============================================ */
@media (max-width: 320px) {
    .hero-title {
        font-size: 1.25rem !important;
        line-height: 1.2;
        padding: 0 0.4rem;
    }

    .hero-input-wrapper {
        padding: 0 0.2rem;
    }

    .hero-input {
        font-size: 0.8rem;
        padding: 0.65rem 0.5rem;
    }

    .hero-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.25rem !important;
        padding: 0 0.4rem;
    }

    .feature-card {
        padding: 0.875rem;
    }

    .feature-icon {
        width: 44px;
        height: 44px;
    }

    .feature-title {
        font-size: 0.9rem;
    }

    .feature-description {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    /* Grid spacing */
    div[style*="grid-template-columns"] {
        gap: 0.875rem !important;
    }

    /* Text adjustments */
    h2[style*="font-size: 2rem"] {
        font-size: 1.2rem !important;
    }

    h3[style*="font-size: 1.25rem"] {
        font-size: 0.95rem !important;
    }

    p[style*="line-height: 1.8"] {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    /* Padding adjustments */
    section[style*="padding: 4rem 0"] {
        padding: 1.75rem 0 !important;
    }

    div[style*="padding: 2rem"] {
        padding: 1rem !important;
    }

    div[style*="padding: 1.5rem"] {
        padding: 0.875rem !important;
    }

    .container {
        padding: 0 0.75rem !important;
    }

    /* CTA improvements */
    .cta-title {
        font-size: 1.05rem !important;
        padding: 1.75rem 0.875rem !important;
    }

    /* Button improvements */
    .btn {
        font-size: 0.85rem;
        padding: 0.7rem 1rem;
    }

    #localUploadToggle {
        font-size: 0.8rem !important;
        padding: 0.75rem 0.875rem !important;
        gap: 0.35rem !important;
    }

    /* Nav improvements */
    .nav-link {
        font-size: 0.85rem;
        padding: 0.7rem 0.8rem;
    }

    .mobile-menu-toggle {
        font-size: 1.6rem;
        padding: 0.4rem;
    }

    .logo-img {
        height: 28px;
    }

    /* Footer */
    .footer-logo {
        height: 50px !important;
    }

    .footer-heading {
        font-size: 0.95rem;
    }

    .footer-link,
    .footer-text {
        font-size: 0.8rem;
    }

    .footer-grid {
        gap: 1.25rem;
    }

    /* Video editor specific */
    .time-input-small {
        font-size: 0.8rem;
        padding: 0.6rem 0.4rem;
    }

    .tab {
        font-size: 0.8rem;
        padding: 0.55rem 0.7rem;
    }

    /* Cards */
    .card {
        padding: 0.875rem !important;
    }

    div[style*="border-radius: 8px; padding: 1.5rem"] {
        padding: 1rem !important;
    }

    div[style*="border-left: 4px solid"] {
        padding: 1rem !important;
    }

    /* Video upload improvements */
    #localUploadSection h3 {
        font-size: 0.85rem !important;
        line-height: 1.2;
        padding: 0.5rem;
    }

    #localUploadSection p {
        font-size: 0.8rem !important;
    }

    #localUploadSection .video-placeholder {
        min-height: 140px;
    }

    #localUploadSection video {
        max-height: 180px;
    }

    #localUploadSection .clip-item {
        padding: 0.65rem;
    }

    #localUploadSection .time-input-small {
        font-size: 0.85rem;
        padding: 0.55rem 0.4rem;
    }

    /* Extra compact clip cards */
    #localUploadSection .clip-item {
        padding: 0.65rem !important;
        margin-bottom: 0.65rem !important;
    }

    #localUploadSection .clip-item h4 {
        font-size: 0.85rem !important;
        margin-bottom: 0.55rem !important;
    }

    #localUploadSection .remove-clip {
        top: 0.55rem !important;
        right: 0.55rem !important;
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        font-size: 0.95rem !important;
    }

    #localUploadSection label {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }
}