/* ================================
   COMPREHENSIVE RESPONSIVE ENHANCEMENTS
   NetworkUstad Theme - All Components
   ================================ */

/* ================================
   RESPONSIVE BREAKPOINTS
   ================================ */
:root {
    --mobile-s: 320px;
    --mobile-m: 375px;
    --mobile-l: 425px;
    --tablet: 768px;
    --laptop: 1024px;
    --laptop-l: 1440px;
    --desktop: 2560px;
}

/* ================================
   HEADER RESPONSIVE ENHANCEMENTS
   ================================ */

/* Large tablets and small laptops */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 2rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .ultra-modern-header {
        height: 70px;
    }
    
    .header-container {
        height: 70px;
        padding: 0 1.5rem;
    }
    
    .site-logo-modern .logo-text {
        font-size: 1.25rem;
    }
    
    .logo-icon-modern svg {
        width: 32px;
        height: 32px;
    }
    
    /* Mobile navigation */
    .main-navigation {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        transform: translateY(-100vh);
        transition: transform 0.3s ease;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .main-navigation.active {
        transform: translateY(0);
    }
    
    .nav-menu {
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 0;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
        font-weight: 500;
        color: var(--text-color);
        border-radius: 0;
    }
    
    .nav-menu a:hover {
        background: rgba(37, 99, 235, 0.05);
        color: #2563eb;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Search form mobile adjustments */
    .header-search-form {
        top: 70px;
    }
    
    .search-input-wrapper {
        flex: 1;
    }
    
    .search-field {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .site-logo-modern .logo-text {
        font-size: 1.1rem;
    }
    
    .logo-icon-modern svg {
        width: 28px;
        height: 28px;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions button {
        width: 36px;
        height: 36px;
    }
    
    .nav-menu {
        padding: 1.5rem 1rem;
    }
}

/* ================================
   FOOTER RESPONSIVE ENHANCEMENTS
   ================================ */

@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .modern-footer {
        padding: 3rem 0 2rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-widget-title {
        justify-content: center;
        font-size: 1.1rem;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .modern-footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-container {
        gap: 1.5rem;
    }
    
    .footer-widget-title {
        font-size: 1rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-social a {
        width: 36px;
        height: 36px;
    }
}

/* ================================
   SINGLE POST RESPONSIVE ENHANCEMENTS
   ================================ */

@media (max-width: 1024px) {
    .tech-article-container {
        padding: 0 2rem;
    }
    
    .tech-article-header {
        padding: 2rem 0;
    }
    
    .tech-article-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .tech-article-container {
        padding: 0 1.5rem;
    }
    
    .tech-article-header {
        padding: 1.5rem 0;
    }
    
    .tech-article-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .tech-article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tech-article-content {
        padding: 2rem 0;
    }
    
    .tech-article-content h2 {
        font-size: 1.5rem;
    }
    
    .tech-article-content h3 {
        font-size: 1.25rem;
    }
    
    /* Table responsive */
    .tech-article-content table {
        font-size: 0.875rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .tech-article-content table th,
    .tech-article-content table td {
        padding: 0.5rem;
        min-width: 100px;
    }
    
    /* Code blocks responsive */
    .tech-article-content pre {
        font-size: 0.8rem;
        overflow-x: auto;
    }
    
    /* Share buttons mobile */
    .nu-floating-share {
        position: static;
        margin: 2rem 0;
        justify-content: center;
    }
    
    .share-btn-enhanced {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .tech-article-container {
        padding: 0 1rem;
    }
    
    .tech-article-title {
        font-size: 1.5rem;
    }
    
    .tech-article-content {
        padding: 1.5rem 0;
    }
    
    .tech-article-content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .share-btn-enhanced {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ================================
   TOOLS PAGE RESPONSIVE ENHANCEMENTS
   ================================ */

@media (max-width: 1024px) {
    .tools-hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tools-hero {
        padding: 3rem 0 2rem;
    }
    
    .tools-hero h1 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .tool-interface {
        padding: 2rem 0;
    }
    
    .tool-form {
        gap: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .tools-hero {
        padding: 2rem 0 1.5rem;
    }
    
    .tools-hero h1 {
        font-size: 1.75rem;
    }
    
    .tool-card {
        padding: 1.25rem;
    }
    
    .tool-card h3 {
        font-size: 1.1rem;
    }
    
    .tool-interface {
        padding: 1.5rem 0;
    }
    
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ================================
   COMMUNITY RESPONSIVE ENHANCEMENTS
   ================================ */

@media (max-width: 768px) {
    .community-forum-wrapper {
        padding: 1rem;
    }
    
    .forum-header {
        padding: 2rem 0;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .header-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .forum-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .category-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }
    
    .community-modal .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 480px) {
    .community-forum-wrapper {
        padding: 0.75rem;
    }
    
    .forum-stats {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        min-width: 100%;
        font-size: 0.9rem;
    }
    
    .community-modal .modal-content {
        margin: 0.5rem;
    }
}

/* ================================
   HOMEPAGE RESPONSIVE ENHANCEMENTS
   ================================ */

@media (max-width: 1024px) {
    .hero-section {
        padding: 4rem 0 3rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .article-card {
        padding: 1.25rem;
    }
    
    .homepage-section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 0 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .article-card {
        padding: 1rem;
    }
    
    .article-card h3 {
        font-size: 1.1rem;
    }
    
    .homepage-section {
        padding: 1.5rem 0;
    }
}

/* ================================
   GENERAL RESPONSIVE UTILITIES
   ================================ */

/* Text scaling for better readability */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    body {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    
    body {
        font-size: 0.9rem;
    }
}

/* Container responsive padding */
@media (max-width: 1200px) {
    .container,
    .ast-container {
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    .container,
    .ast-container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .container,
    .ast-container {
        padding: 0 1rem;
    }
}

/* Button responsive sizing */
@media (max-width: 768px) {
    .btn,
    .button,
    .wp-block-button__link {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .btn,
    .button,
    .wp-block-button__link {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Form elements responsive */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="search"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
    }
}

/* Image responsive */
@media (max-width: 768px) {
    img {
        height: auto;
        max-width: 100%;
    }
    
    .wp-block-image {
        margin: 1rem 0;
    }
}

/* Accessibility improvements for touch devices */
@media (max-width: 768px) {
    button,
    .btn,
    a {
        min-height: 44px; /* Minimum touch target size */
        min-width: 44px;
    }
    
    /* Larger tap targets for small buttons */
    .header-actions button {
        width: 44px;
        height: 44px;
    }
}

/* Reduce motion for users who prefer it */
@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 support */
@media (prefers-contrast: high) {
    .article-card,
    .tool-card,
    .stat-card {
        border: 2px solid currentColor;
    }
    
    button,
    .btn {
        border: 2px solid currentColor;
    }
}

/* Print styles */
@media print {
    .ultra-modern-header,
    .modern-footer,
    .floating-community-btn,
    .nu-floating-share,
    .reading-progress-bar {
        display: none !important;
    }
    
    .tech-article-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .tech-article-title {
        font-size: 18pt;
        margin-bottom: 12pt;
    }
}
