/* ========================================
   RESPONSIVE DESIGN - responsive.css
   Mobile-first approach with breakpoints
======================================== */

/* Base styles are mobile-first (already defined in main CSS) */

/* ========================================
   MOBILE DEVICES (320px - 480px)
======================================== */
@media screen and (max-width: 480px) {
    
    /* Container adjustments */
    .container {
        padding: 0 15px;
    }
    
    /* Header */
    .site-header {
        padding: 15px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .main-navigation {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        z-index: 1001;
        padding: 80px 20px 20px;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .menu-items {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .menu-items li {
        margin: 0;
    }
    
    .menu-items a {
        font-size: 24px;
        padding: 15px 0;
    }
    
    .mobile-menu-btn {
        display: block;
        z-index: 1002;
    }
    
    .close-menu {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 30px;
        color: var(--text-color);
        cursor: pointer;
    }
    
    /* Hero Section */
    .hero {
        padding: 60px 0;
        min-height: 80vh;
    }
    
    .hero h1 {
        font-size: 28px;
        line-height: 1.3;
    }
    
    .hero p {
        font-size: 16px;
        margin-bottom: 25px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
        margin: 8px 0;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    /* About Section */
    .about {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .about-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .about-text h3 {
        font-size: 20px;
    }
    
    .skill-tags {
        justify-content: center;
    }
    
    .skill-tag {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    /* Projects Section */
    .projects {
        padding: 60px 0;
    }
    
    .projects-filter {
        margin-bottom: 30px;
    }
    
    .filter-btn {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-card {
        margin: 0 auto;
        max-width: 100%;
    }
    
    .project-content {
        padding: 15px;
    }
    
    .project-content h3 {
        font-size: 18px;
    }
    
    .project-tags {
        gap: 5px;
    }
    
    .project-tag {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    /* Contact Section */
    .contact {
        padding: 60px 0;
    }
    
    .contact-form {
        padding: 20px;
        margin: 0 15px;
    }
    
    .form-control {
        padding: 10px;
    }
    
    /* Footer */
    .site-footer {
        padding: 30px 0;
    }
    
    .social-links {
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
    }
    
    /* Back to top button */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 35px;
        height: 35px;
    }
    
    /* Project Single Page */
    .project-single {
        padding: 60px 0;
    }
    
    .project-title {
        font-size: 24px;
    }
    
    .project-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .project-navigation {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-previous, .nav-next {
        max-width: 100%;
        text-align: center;
    }
    
    /* Calculator Pages */
    .calculator {
        margin: 0 15px;
        padding: 20px;
    }
    
    .calculator h2 {
        font-size: 20px;
    }
    
    .qr-settings {
        flex-direction: column;
        gap: 15px;
    }
    
    .qr-setting-group {
        min-width: auto;
    }
    
    .qr-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .qr-btn {
        width: 100%;
        justify-content: center;
    }
    
    .qr-templates-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .qr-help-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Error 404 */
    .error-404 .page-title {
        font-size: 80px;
    }
    
    .error-404 .page-subtitle {
        font-size: 24px;
    }
}

/* ========================================
   SMALL TABLETS (481px - 768px)
======================================== */
@media screen and (min-width: 481px) and (max-width: 768px) {
    
    /* Header */
    .main-navigation {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        z-index: 1001;
        padding: 80px 20px 20px;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .menu-items {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .menu-items li {
        margin: 0;
    }
    
    .menu-items a {
        font-size: 20px;
    }
    
    .mobile-menu-btn {
        display: block;
        z-index: 1002;
    }
    
    /* Hero Section */
    .hero h1 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 17px;
    }
    
    .cta-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    /* About Section */
    .about-content {
        gap: 35px;
    }
    
    /* Projects Section */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    /* Calculator */
    .qr-settings {
        gap: 18px;
    }
    
    .qr-templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qr-help-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   TABLETS (769px - 1024px)
======================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    
    /* Header - Show normal navigation */
    .mobile-menu-btn {
        display: none;
    }
    
    .main-navigation {
        display: block;
    }
    
    .menu-items {
        display: flex;
        flex-direction: row;
    }
    
    /* Hero Section */
    .hero h1 {
        font-size: 42px;
    }
    
    /* Projects Section */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    /* About content side by side */
    .about-content {
        display: flex;
        gap: 40px;
    }
    
    /* Calculator settings in row */
    .qr-settings {
        flex-direction: row;
        gap: 20px;
    }
}

/* ========================================
   LARGE TABLETS / SMALL LAPTOPS (1025px - 1200px)
======================================== */
@media screen and (min-width: 1025px) and (max-width: 1200px) {
    
    /* Projects - 3 columns */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Container max-width adjustment */
    .container {
        max-width: 1000px;
    }
}

/* ========================================
   DESKTOP (1201px and above)
======================================== */
@media screen and (min-width: 1201px) {
    
    /* Full desktop layout - use base styles */
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ========================================
   LARGE SCREENS (1400px and above)
======================================== */
@media screen and (min-width: 1400px) {
    
    .container {
        max-width: 1300px;
    }
    
    .hero h1 {
        font-size: 52px;
    }
    
    .section-title {
        font-size: 36px;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION ADJUSTMENTS
======================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    
    .hero {
        min-height: auto;
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    .hero p {
        margin-bottom: 20px;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .main-navigation {
        padding: 40px 20px 20px;
    }
    
    .menu-items {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .menu-items a {
        font-size: 16px;
    }
}

/* ========================================
   HIGH DPI / RETINA DISPLAYS
======================================== */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    
    /* Enhance text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Sharper borders */
    .project-card,
    .contact-form,
    .calculator {
        border: 0.5px solid var(--border-color);
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    
    /* Hide non-essential elements */
    .site-header,
    .mobile-menu-btn,
    .scroll-indicator,
    .back-to-top,
    .site-footer,
    .social-links,
    .cta-buttons,
    .projects-filter,
    .contact-form {
        display: none;
    }
    
    /* Adjust colors for print */
    body {
        background: white;
        color: black;
    }
    
    .section-title {
        color: black;
        border-bottom: 2px solid black;
        padding-bottom: 10px;
    }
    
    /* Page breaks */
    .hero,
    .about,
    .projects,
    .contact {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    /* Optimize spacing */
    .hero,
    .about,
    .projects,
    .contact {
        padding: 20px 0;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
======================================== */

/* Focus indicators for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .form-control:focus,
    .menu-items a:focus,
    .filter-btn:focus {
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
    }
}

/* Reduced 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;
        scroll-behavior: auto !important;
    }
    
    .loader {
        animation: none;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    
    :root {
        --accent-color: #0066cc;
        --border-color: #000000;
        --text-color: #000000;
        --bg-color: #ffffff;
    }
    
    .btn-primary {
        border: 2px solid #000000;
    }
    
    .project-card {
        border: 2px solid #000000;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    
    /* Default dark theme variables are already defined in main CSS */
    /* This ensures dark mode works even without manual toggle */
    
}

/* ========================================
   UTILITY CLASSES FOR RESPONSIVE DESIGN
======================================== */

/* Hide/Show elements on different screen sizes */
.hide-mobile {
    display: none;
}

.hide-tablet {
    display: block;
}

.hide-desktop {
    display: block;
}

@media screen and (min-width: 769px) {
    .hide-mobile {
        display: block;
    }
    
    .hide-tablet {
        display: none;
    }
    
    .show-tablet {
        display: block;
    }
}

@media screen and (min-width: 1025px) {
    .hide-desktop {
        display: none;
    }
    
    .show-desktop {
        display: block;
    }
    
    .hide-tablet {
        display: block;
    }
}

/* Responsive text sizes */
.text-responsive {
    font-size: 14px;
}

@media screen and (min-width: 481px) {
    .text-responsive {
        font-size: 16px;
    }
}

@media screen and (min-width: 769px) {
    .text-responsive {
        font-size: 18px;
    }
}

/* Responsive spacing */
.spacing-responsive {
    padding: 15px 0;
}

@media screen and (min-width: 481px) {
    .spacing-responsive {
        padding: 25px 0;
    }
}

@media screen and (min-width: 769px) {
    .spacing-responsive {
        padding: 40px 0;
    }
}

@media screen and (min-width: 1025px) {
    .spacing-responsive {
        padding: 60px 0;
    }
}