/* Mobile Responsive Improvements for eChallan Portal */

/* Base Mobile Optimizations */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevents auto-zoom on iOS */
        -webkit-text-size-adjust: 100%;
    }
    
    /* Hero Sections */
    .hero-section,
    .state-hero {
        padding: 40px 15px !important;
    }
    
    .hero-content h1,
    .state-hero h1 {
        font-size: 1.8em !important;
        line-height: 1.3 !important;
        margin-bottom: 10px !important;
    }
    
    .hero-subtitle {
        font-size: 1.1em !important;
    }
    
    .hero-description {
        font-size: 1em !important;
    }
    
    /* Main Container */
    .main-container,
    .state-content {
        padding: 15px !important;
    }
    
    /* Challan Check Section */
    .challan-check-section {
        padding: 20px 15px !important;
        margin-bottom: 20px !important;
    }
    
    .challan-check-section h2 {
        font-size: 1.5em !important;
        margin-bottom: 20px !important;
    }
    
    /* Form Elements - Touch Friendly */
    .form-group input[type="text"],
    .form-group select,
    .challan-form input,
    .search-box input {
        padding: 14px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 48px !important; /* Touch-friendly */
        border-radius: 8px !important;
    }
    
    /* Buttons - Touch Friendly */
    .submit-btn,
    .test-button,
    .btn-home,
    .btn-help,
    button {
        padding: 14px 20px !important;
        font-size: 16px !important;
        min-height: 48px !important; /* Touch-friendly minimum */
        border-radius: 8px !important;
        cursor: pointer;
    }
    
    .refresh-btn {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 12px !important;
    }
    
    /* Captcha Container */
    .captcha-container {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .captcha-image {
        width: 100% !important;
        text-align: center !important;
        padding: 12px 20px !important;
    }
    
    .refresh-btn {
        width: 100% !important;
    }
    
    /* State Grid */
    .state-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .state-card {
        padding: 20px 15px !important;
        min-height: 120px !important;
    }
    
    .state-card h3 {
        font-size: 1.3em !important;
    }
    
    .state-icon {
        font-size: 2.5em !important;
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Features Grid */
    .features-grid,
    .links-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .feature-card,
    .link-card {
        padding: 20px 15px !important;
    }
    
    /* Insurance Section */
    .insurance-cta-section {
        padding: 30px 15px !important;
        margin: 20px 0 !important;
    }
    
    .insurance-header h2 {
        font-size: 1.6em !important;
    }
    
    .insurance-benefits {
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: center !important;
    }
    
    .benefit-badge {
        font-size: 0.85em !important;
        padding: 8px 12px !important;
    }
    
    .insurance-buttons {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .insurance-btn {
        padding: 20px 15px !important;
        min-height: 140px !important;
    }
    
    .insurance-btn h3 {
        font-size: 1.2em !important;
    }
    
    .insurance-btn .description {
        font-size: 0.9em !important;
        line-height: 1.4 !important;
    }
    
    .trust-indicators {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .trust-item {
        padding: 12px 8px !important;
    }
    
    .trust-item .number {
        font-size: 1.3em !important;
    }
    
    .trust-item .label {
        font-size: 0.8em !important;
    }
    
    /* Violations Table */
    .violations-table {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .violations-table table {
        min-width: 500px !important;
        font-size: 0.9em !important;
    }
    
    .violations-table th,
    .violations-table td {
        padding: 10px 8px !important;
    }
    
    /* RTO Offices */
    .rto-offices {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .rto-card {
        padding: 15px !important;
    }
    
    .rto-card h3 {
        font-size: 1.1em !important;
    }
    
    /* FAQ Section */
    .faq-item {
        padding: 15px !important;
    }
    
    .faq-question {
        font-size: 1em !important;
        padding-right: 30px !important;
    }
    
    .faq-answer {
        font-size: 0.95em !important;
        line-height: 1.5 !important;
    }
    
    /* Breadcrumbs */
    .state-breadcrumbs {
        padding: 10px 15px !important;
        font-size: 0.9em !important;
    }
    
    /* Footer */
    .site-footer {
        padding: 40px 15px 20px !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    .footer-states {
        grid-column: span 1 !important;
    }
    
    .states-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .footer-stats {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Traffic Light Overlay */
    .traffic-light-overlay {
        padding: 20px !important;
    }
    
    .traffic-light-container {
        padding: 30px 20px !important;
    }
    
    .traffic-light {
        width: 80px !important;
        padding: 15px !important;
    }
    
    .light {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Security Note */
    .security-note {
        padding: 15px !important;
        font-size: 0.9em !important;
    }
    
    /* Info Cards */
    .info-card {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .info-card h3 {
        font-size: 1.2em !important;
    }
    
    .info-card ul {
        font-size: 0.95em !important;
    }
    
    /* State Stats */
    .state-stats {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .pending-challans {
        flex-direction: row !important;
        gap: 8px !important;
    }
    
    /* Search Box */
    .search-box form {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .search-box button {
        width: 100% !important;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    .hero-content h1,
    .state-hero h1 {
        font-size: 1.5em !important;
    }
    
    .challan-check-section h2 {
        font-size: 1.3em !important;
    }
    
    .state-card {
        padding: 15px !important;
    }
    
    .insurance-btn {
        padding: 15px 12px !important;
    }
    
    .trust-indicators {
        grid-template-columns: 1fr !important;
    }
    
    .footer-links {
        font-size: 0.9em !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section,
    .state-hero {
        padding: 30px 15px !important;
    }
    
    .hero-content h1,
    .state-hero h1 {
        font-size: 1.6em !important;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .state-card:hover,
    .feature-card:hover,
    .link-card:hover {
        transform: none !important;
    }
    
    /* Add active states instead */
    .state-card:active,
    .feature-card:active,
    .link-card:active,
    button:active,
    .submit-btn:active {
        transform: scale(0.98) !important;
        opacity: 0.9;
    }
}

/* Improve Readability */
@media (max-width: 768px) {
    p {
        line-height: 1.6 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3 !important;
        word-wrap: break-word !important;
    }
    
    /* Prevent text overflow */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Loading Performance */
@media (max-width: 768px) {
    /* Lazy load images */
    img {
        loading: lazy;
    }
    
    /* Reduce animations on mobile */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* Accessibility Improvements */
@media (max-width: 768px) {
    /* Ensure sufficient color contrast */
    .hero-section,
    .state-hero {
        color: #ffffff;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    }
    
    /* Focus indicators for keyboard navigation */
    a:focus,
    button:focus,
    input:focus,
    select:focus {
        outline: 3px solid #667eea !important;
        outline-offset: 2px !important;
    }
}
