/* ========================================
   RESPONSIVE STYLES
   Mobile-First Approach
   ======================================== */

/* ============ TABLET & BELOW (1024px) ============ */
@media (max-width: 1024px) {
    :root {
        --space-xl: 4rem;
        --space-lg: 3rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .hero-visual {
        height: 400px;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .modal-content {
        grid-template-columns: 1fr;
    }

    .modal-image {
        min-height: 400px;
    }

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

/* ============ MOBILE NAVIGATION BREAKPOINT (768px) ============ */
@media (max-width: 768px) {
    :root {
        --space-xl: 3rem;
        --space-lg: 2rem;
        --space-md: 1.5rem;
    }

    /* Navigation */
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-navbar {
        display: block;
    }

    /* Hero */
    .hero-section {
        padding: 6rem 0 2rem;
    }

    .hero-text {
        text-align: center;
    }

    .hero-description {
        margin: 0 auto var(--space-lg);
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-cta .cta-primary,
    .hero-cta .cta-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-socials {
        justify-content: center;
    }

    .hero-visual {
        display: none;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

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

    /* Work Section */
    .work-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* About */
    .about-skills {
        grid-template-columns: 1fr;
        padding: var(--space-md);
    }

    .about-visual {
        height: 400px;
    }

    .stack-item {
        padding: var(--space-sm);
    }

    .item-1,
    .item-2,
    .item-3 {
        width: 180px;
    }

    /* Process */
    .process-step {
        grid-template-columns: 80px 1fr;
        gap: var(--space-md);
    }

    .step-number {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }

    .process-step:not(:last-child)::after {
        left: 39px;
    }

    /* Contact */
    .contact-methods {
        gap: var(--space-sm);
    }

    .contact-method {
        padding: var(--space-sm);
    }

    .method-icon {
        width: 40px;
        height: 40px;
    }

    .method-icon i {
        font-size: 1.25rem;
    }

    .contact-form {
        padding: var(--space-md);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
    }

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

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    /* Modal */
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .modal-info {
        padding: var(--space-md);
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .modal-info::-webkit-scrollbar {
        display: none;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .cta-primary,
    .modal-actions .cta-secondary {
        width: 100%;
    }

    /* Theme Toggle */
    .theme-toggle {
        top: 80px;
        right: 1rem;
        width: 40px;
        height: 40px;
    }

    .theme-toggle i {
        font-size: 1.25rem;
    }
}

/* ============ SMALL MOBILE (480px) ============ */
@media (max-width: 480px) {
    :root {
        --space-xl: 2rem;
        --space-lg: 1.5rem;
    }

    h1 { font-size: clamp(2rem, 10vw, 3rem); }
    h2 { font-size: clamp(1.5rem, 8vw, 2.5rem); }

    /* Navigation */
    .navbar-container {
        padding: 1rem var(--space-sm);
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    .mobile-nav-links {
        gap: var(--space-sm);
    }

    .mobile-nav-links a {
        width: 45px;
        height: 45px;
    }

    .mobile-nav-links i {
        font-size: 1.25rem;
    }

    /* Hero */
    .floating-card {
        padding: 1rem;
    }

    .floating-card i {
        font-size: 1.5rem;
    }

    .floating-card span {
        font-size: 0.75rem;
    }

    .gradient-orb {
        filter: blur(60px);
    }

    .orb-1 {
        width: 300px;
        height: 300px;
    }

    .orb-2 {
        width: 250px;
        height: 250px;
    }

    .orb-3 {
        width: 200px;
        height: 200px;
    }

    /* Buttons */
    .cta-primary,
    .cta-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }

    .hero-socials a,
    .social-links a {
        width: 45px;
        height: 45px;
    }

    .hero-socials i,
    .social-links i {
        font-size: 1.25rem;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-item {
        padding: var(--space-sm);
    }

    /* Work */
    .section-header {
        margin-bottom: var(--space-lg);
    }

    .project-image {
        height: 220px;
    }

    .project-info {
        padding: var(--space-sm);
    }

    .project-title {
        font-size: 1.25rem;
    }

    /* About */
    .about-visual {
        height: 350px;
    }

    .stack-item {
        width: 150px !important;
        padding: 1rem;
    }

    .stack-item i {
        font-size: 2rem;
    }

    .stack-item span {
        font-size: 0.875rem;
    }

    .item-1 {
        top: 5%;
        left: 0;
    }

    .item-2 {
        top: 40%;
        right: 0;
    }

    .item-3 {
        bottom: 5%;
        left: 10%;
    }

    /* Process */
    .process-step {
        grid-template-columns: 60px 1fr;
        gap: var(--space-sm);
        padding: var(--space-md) 0;
    }

    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
        border-width: 2px;
    }

    .process-step:not(:last-child)::after {
        left: 29px;
    }

    .step-content h3 {
        font-size: 1.125rem;
    }

    .step-content p {
        font-size: 0.95rem;
    }

    /* Testimonials */
    .testimonials-slider {
        min-height: 400px;
    }

    .testimonial-content {
        padding: var(--space-md);
    }

    .testimonial-text {
        font-size: 1rem;
    }

    .author-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .testimonial-prev,
    .testimonial-next {
        width: 40px;
        height: 40px;
    }

    .testimonial-prev i,
    .testimonial-next i {
        font-size: 1.25rem;
    }

    /* Contact */
    .contact-methods {
        margin-bottom: var(--space-md);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    /* Footer */
    .footer {
        padding: var(--space-lg) 0 var(--space-sm);
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .footer-column {
        text-align: center;
    }

    .footer-bottom {
        font-size: 0.75rem;
    }

    /* Modal */
    .modal-close {
        width: 40px;
        height: 40px;
        top: 0.5rem;
        right: 0.5rem;
    }

    .modal-close i {
        font-size: 1.25rem;
    }

    .modal-image {
        min-height: 250px;
    }

    .modal-nav {
        bottom: 1rem;
        gap: 0.5rem;
    }

    .modal-prev,
    .modal-next {
        width: 40px;
        height: 40px;
    }

    .modal-details {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    .detail-item {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }

    .success-icon {
        width: 60px;
        height: 60px;
    }

    .success-icon i {
        font-size: 2rem;
    }

    /* Loading */
    .loader {
        width: 150px;
    }

    .loading-text {
        font-size: 0.875rem;
    }
}

/* ============ LANDSCAPE MOBILE ============ */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 4rem 0 2rem;
    }

    .floating-card {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .about-visual {
        display: none;
    }

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

/* ============ HIGH RESOLUTION DISPLAYS ============ */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    h1 { font-size: 6rem; }
    h2 { font-size: 4rem; }

    .hero-section {
        min-height: 90vh;
    }

    .hero-visual {
        height: 600px;
    }

    .floating-card {
        padding: 2rem;
    }

    .floating-card i {
        font-size: 3rem;
    }

    .project-image {
        height: 350px;
    }

    .about-visual,
    .visual-stack {
        height: 600px;
    }

    .stack-item {
        padding: var(--space-lg);
    }

    .item-1,
    .item-2,
    .item-3 {
        width: 280px;
    }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .gradient-orb {
        animation: none;
    }

    .floating-card {
        animation: none;
    }

    .scroll-line {
        animation: none;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    .navbar,
    .mobile-navbar,
    .theme-toggle,
    .cursor-dot,
    .cursor-outline,
    .hero-socials,
    .scroll-indicator,
    .work-filters,
    .project-overlay,
    .testimonial-controls,
    .contact-form,
    .footer,
    .loading-screen {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero-section,
    .stats-section,
    .work-section,
    .about-section,
    .process-section,
    .testimonials-section,
    .contact-section {
        page-break-inside: avoid;
        padding: 2rem 0;
    }

    h1, h2, h3, h4, h5, h6 {
        color: black;
    }

    p {
        color: #333;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* ============ ACCESSIBILITY FOCUS STYLES ============ */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 5px;
}

/* ============ DARK MODE SPECIFIC ADJUSTMENTS ============ */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --primary: #00ff88;
        --bg-dark: #0a0a0a;
        --bg-medium: #1a1a1a;
        --bg-light: #2a2a2a;
        --bg-card: #151515;
        --text-primary: #ffffff;
        --text-secondary: #a0a0a0;
        --text-muted: #666666;
    }
}

@media (prefers-color-scheme: light) {
    [data-theme="auto"] {
        --primary: #00cc6f;
        --bg-dark: #ffffff;
        --bg-medium: #f5f5f5;
        --bg-light: #e5e5e5;
        --bg-card: #fafafa;
        --text-primary: #0a0a0a;
        --text-secondary: #4a4a4a;
        --text-muted: #9a9a9a;
    }
}