/* Responsive Breakpoints */
/* Mobile: 320px - 767px */
/* Tablet: 768px - 1023px */
/* Desktop: 1024px and up */

/* Tablet and Below */
@media (max-width: 1023px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .section {
        padding: var(--spacing-xl) 0;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-lg);
    }

    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-lg);
    }

    .hero-buttons,
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary,
    .download-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Mobile Only */
@media (max-width: 767px) {
    /* Navigation - Show links without hiding */
    .navbar {
        padding: 1rem 0;
    }

    .navbar .container {
        padding: 0 15px;
    }

    .nav-brand {
        font-size: 1.25rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-brand img {
        width: 32px;
        height: 32px;
    }

    .nav-links {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        padding: 1rem 0;
        gap: 0;
        margin: 0;
        list-style: none;
        z-index: 1000;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.active {
        max-height: 300px;
    }

    .nav-links li {
        margin: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 1rem;
        color: var(--text-dark);
        text-decoration: none;
        font-weight: 500;
        transition: background-color 0.3s ease;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: var(--primary-green);
        background-color: var(--pale-green);
    }

    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        color: var(--primary-green);
        z-index: 1001;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--primary-green);
        margin: 2px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Hero Section */
    .hero {
        padding: calc(70px + var(--spacing-xl)) 0 var(--spacing-xl);
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }

    .hero-buttons {
        gap: var(--spacing-sm);
    }

    .btn-primary,
    .btn-secondary {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 1rem;
    }

    /* Features Section */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem 0;
        padding: 0 1rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
        margin: 0;
        background-color: var(--white);
        border-radius: 12px;
        box-shadow: var(--shadow);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .feature-card h3 {
        font-size: 1.25rem;
    }

    /* Section Titles */
    .section-title h2 {
        font-size: 1.75rem;
    }

    .section-title p {
        font-size: 1rem;
        padding: 0 var(--spacing-sm);
    }

    /* Download Section */
    .download {
        padding: var(--spacing-xl) 0;
    }

    .download h2 {
        font-size: 1.75rem;
    }

    .download p {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }

    .download-buttons {
        gap: var(--spacing-sm);
    }

    .download-btn {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 1rem;
    }

    /* Footer */
    footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        margin-bottom: 2rem;
        text-align: left;
    }

    .footer-section h4,
    .footer-column h4 {
        margin-bottom: 1rem;
        font-size: 1.1rem;
        color: var(--light-green);
    }

    .footer-section ul,
    .footer-column ul {
        display: block;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .footer-section ul li,
    .footer-column ul li {
        margin-bottom: 0.75rem;
        width: 100%;
    }

    .footer-section a,
    .footer-column a {
        color: var(--white) !important;
        text-decoration: none;
        opacity: 0.8;
        transition: all 0.3s ease;
        display: block;
        padding: 0.25rem 0;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .footer-section a:hover,
    .footer-column a:hover,
    .footer-section a:focus,
    .footer-column a:focus {
        opacity: 1;
        color: var(--light-green) !important;
        text-decoration: underline;
    }

    .footer-bottom {
        text-align: center;
        font-size: 0.875rem;
        opacity: 0.8;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1.5rem;
        margin-top: 1rem;
    }
}

/* Small Mobile Only */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
        padding: 0 0.5rem;
    }

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

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    .feature-card p {
        font-size: 0.95rem;
    }

    footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-section h4,
    .footer-column h4 {
        font-size: 1rem;
        text-align: center;
    }

    .footer-section a,
    .footer-column a {
        font-size: 0.9rem;
        text-align: center;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Help Center Responsive Styles */
    .help-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
    }

    .guides-grid {
        grid-template-columns: 1fr;
    }

    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }

    .faq-categories {
        flex-direction: column;
        align-items: center;
    }

    .faq-category-btn {
        width: 200px;
    }

    .help-cta {
        padding: 2rem 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .guide-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .guide-meta {
        align-items: flex-start;
        flex-direction: row;
        gap: 1rem;
    }
}

/* Large Desktop Only */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Landscape Phone */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: calc(60px + var(--spacing-lg)) 0 var(--spacing-lg);
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.95rem;
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand img,
    .feature-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Documentation Page Responsive Styles */

/* Tablet and Below - Documentation */
@media (max-width: 1023px) {
    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-green) var(--pale-green);
    }

    .tab-navigation::-webkit-scrollbar {
        height: 6px;
    }

    .tab-navigation::-webkit-scrollbar-track {
        background: var(--pale-green);
        border-radius: 3px;
    }

    .tab-navigation::-webkit-scrollbar-thumb {
        background: var(--primary-green);
        border-radius: 3px;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-width: 120px;
    }

    .syntax-grid {
        grid-template-columns: 1fr;
    }

    .shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .data-types-grid {
        grid-template-columns: 1fr;
    }

    .tutorial-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .doc-stats {
        gap: 2rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* Mobile Only - Documentation */
@media (max-width: 767px) {
    .page-hero-content h1 {
        font-size: 2rem;
    }

    .doc-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .search-input {
        padding: 0.75rem 3rem 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: 100px;
    }

    .tab-btn svg {
        width: 16px;
        height: 16px;
    }

    .guide-category {
        padding: 1.5rem;
    }

    .guide-item {
        padding: 1rem;
    }

    .guide-item h4 a {
        font-size: 1.1rem;
    }

    .tutorial-card {
        margin: 0 -1rem;
        border-radius: 0;
    }

    .tutorial-header {
        padding: 1rem;
    }

    .tutorial-content {
        padding: 1rem;
    }

    .ref-section {
        padding: 1.5rem 1rem;
        margin: 0 -1rem 2rem;
        border-radius: 0;
    }

    .syntax-card pre,
    .connection-string pre {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    .api-method .method-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .method-details {
        padding: 1rem;
    }

    .param-table {
        font-size: 0.85rem;
    }

    .param-table th,
    .param-table td {
        padding: 0.5rem;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
    }

    .quick-link-card {
        padding: 1rem;
        text-align: center;
    }
}

/* Small Mobile Only - Documentation */
@media (max-width: 480px) {
    .page-hero {
        padding: 100px 0 40px;
    }

    .doc-main {
        padding: 1rem 0;
    }

    .tab-navigation {
        gap: 0.25rem;
        margin-bottom: 1rem;
    }

    .tab-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
        min-width: 80px;
    }

    .tab-btn svg {
        display: none;
    }

    .guide-category h3 {
        font-size: 1.3rem;
    }

    .tutorial-section h3 {
        font-size: 1.5rem;
    }

    .ref-section h3 {
        font-size: 1.3rem;
    }

    .syntax-card h4,
    .connection-string h4 {
        font-size: 1rem;
        padding: 0.5rem;
    }

    .syntax-card pre,
    .connection-string pre {
        padding: 0.75rem;
        font-size: 0.7rem;
    }

    .shortcut-category h4 {
        font-size: 1.1rem;
    }

    .shortcut-table td {
        padding: 0.3rem 0;
        font-size: 0.85rem;
    }

    kbd {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }

    .data-type-table {
        font-size: 0.8rem;
    }

    .data-type-table th,
    .data-type-table td {
        padding: 0.4rem;
    }
}

/* Landscape Phone - Documentation */
@media (max-width: 767px) and (orientation: landscape) {
    .doc-stats {
        flex-direction: row;
        gap: 1rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
    }

    .guide-category,
    .ref-section {
        padding: 1rem;
    }
}

/* Tablet Landscape - Documentation */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .tutorial-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

/* Print Styles */
@media print {
    .navbar,
    .mobile-menu-toggle {
        display: none;
    }

    .hero {
        padding: var(--spacing-lg) 0;
        background: none;
    }

    .download {
        background: none;
        color: var(--text-dark);
    }

    .download h2,
    .download p,
    .download-btn {
        color: var(--text-dark);
        border: 1px solid var(--text-light);
    }

    .footer {
        background: none;
        color: var(--text-dark);
    }

    .footer-section h3 {
        color: var(--text-dark);
    }

    .footer-section a {
        color: var(--text-dark);
    }

    /* Documentation Print Styles */
    .doc-search,
    .tab-navigation {
        display: none !important;
    }

    .tab-pane {
        display: block !important;
        page-break-before: always;
    }

    .tab-pane:first-child {
        page-break-before: auto;
    }

    .guide-category,
    .api-section,
    .tutorial-section,
    .ref-section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }

    .guide-item,
    .api-method,
    .tutorial-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #ccc;
    }

    pre {
        white-space: pre-wrap;
        word-break: break-all;
        background: #f5f5f5 !important;
        color: #000 !important;
        border: 1px solid #ddd;
    }

    .search-highlight {
        background: #ffffcc !important;
        border: 1px solid #666 !important;
        box-shadow: none !important;
        animation: none !important;
    }
}