/* =============================================
   RESPONSIVE DESIGN
   Mobile, Tablet, Desktop Breakpoints
   ============================================= */

/* ===== BREAKPOINTS ===== */
/* 
   Mobile: < 768px
   Tablet: 768px - 1024px
   Desktop: > 1024px
*/

/* ===== TABLET (768px - 1024px) ===== */
@media (max-width: 1024px) {
    /* Container */
    .container {
        padding: 0 1.5rem;
    }

    /* Typography */
    .hero-name {
        font-size: 3rem;
    }

    .hero-title-en {
        font-size: 1.7rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-image {
        order: -1;
    }

    .profile-container {
        width: 300px;
        height: 300px;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Expertise Grid */
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== MOBILE (< 768px) ===== */
@media (max-width: 768px) {
    /* Base Font Size */
    html {
        font-size: 14px;
    }

    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Navigation */
    .nav-container {
        padding: 1rem;
    }

    .mobile-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
        pointer-events: none;
        transition: all 0.35s ease;
        z-index: 998;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: min(88vw, 340px);
        height: 100vh;
        background: linear-gradient(165deg, rgba(12, 16, 20, 0.98), rgba(8, 10, 13, 0.98));
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 5.5rem 1.5rem 2rem;
        gap: 0.75rem;
        transform: translateX(110%);
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        border-left: 1px solid rgba(0, 255, 65, 0.16);
        box-shadow: -20px 0 50px rgba(0, 0, 0, 0.55);
        z-index: 999;
        overflow-y: auto;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .navbar.mobile-menu-open .mobile-menu-backdrop {
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        pointer-events: auto;
    }

    .mobile-menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .mobile-menu-close {
        position: fixed;
        top: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        border: 1px solid rgba(0, 255, 65, 0.25);
        background: rgba(15, 20, 24, 0.95);
        color: var(--neon-green);
        font-size: 1.4rem;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transform: scale(0.9);
        transition: all 0.25s ease;
        box-shadow: 0 0 24px rgba(0, 255, 65, 0.18);
        z-index: 1001;
    }

    .navbar.mobile-menu-open .mobile-menu-close {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1);
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu .nav-link {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding: 0.9rem 1rem;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(0, 255, 65, 0.1);
        font-size: 0.95rem;
    }

    .nav-menu .nav-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .nav-menu .nav-link::before {
        display: none;
    }

    .hire-btn {
        display: none;
    }

    /* Typography */
    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title-en {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-description {
        font-size: 1rem;
    }

    /* Hero Section */
    .hero-section {
        padding: 6rem 0 3rem;
        min-height: auto;
    }

    .hero-container {
        gap: 2rem;
    }

    .profile-container {
        width: 250px;
        height: 250px;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-item {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .scroll-indicator {
        display: none;
    }

    /* Sections */
    section {
        padding: 4rem 0;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    /* Expertise Grid */
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .expertise-card {
        padding: 2rem;
    }

    .card-title {
        font-size: 1.3rem;
    }

    /* Skills Terminal */
    .terminal-content {
        padding: 1.5rem;
        font-size: 0.85rem;
    }

    .skill-item {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .skill-bar {
        grid-column: 1;
    }

    .skill-level {
        text-align: right;
    }

    .skills-chip-list {
        gap: 0.5rem;
    }

    .skill-chip {
        font-size: 0.8rem;
    }

    .top-skill-item {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    /* Tools Grid */
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .tool-icon {
        width: 70px;
        height: 70px;
    }

    /* Projects */
    .projects-grid {
        gap: 1.5rem;
    }

    .project-image {
        height: 200px;
    }

    .project-content {
        padding: 1.5rem;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    /* Articles */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-card {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.2rem;
    }

    /* Timeline */
    .timeline {
        padding-right: 1rem;
    }

    .timeline-item {
        padding-right: 2rem;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .timeline-title {
        font-size: 1.2rem;
    }

    /* Testimonials */
    .testimonials-slider {
        margin-bottom: 1.5rem;
    }

    .testimonial-card {
        padding: 1.5rem;
        flex: 0 0 calc((100% - 1.5rem) / 2);
    }

    .section-terminal-banner {
        margin-bottom: 1.5rem;
    }

    /* Contact */
    .contact-info {
        gap: 1rem;
    }

    .info-card {
        padding: 1rem;
        gap: 1rem;
    }

    .info-icon {
        width: 40px;
        height: 40px;
    }

    .contact-form {
        padding: 2rem;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    /* Newsletter */
    .newsletter-box {
        padding: 2rem;
    }

    .newsletter-title {
        font-size: 2rem;
    }

    .newsletter-description {
        font-size: 1rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-btn {
        width: 100%;
        justify-content: center;
    }

    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-content {
        gap: 2rem;
    }

    .footer-logo {
        font-size: 2rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .footer-social {
        flex-wrap: wrap;
    }

    .footer-bottom {
        font-size: 0.85rem;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1rem;
        left: 1rem;
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 576px) {
    .testimonial-card {
        flex: 0 0 100%;
    }
}

/* ===== SMALL MOBILE (< 480px) ===== */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    /* Navigation */
    .logo-text {
        font-size: 1.5rem;
    }

    .nav-menu {
        max-width: 100%;
        width: 100%;
        right: 0;
    }

    /* Hero */
    .hero-name {
        font-size: 2rem;
    }

    .hero-title-en {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .profile-container {
        width: 200px;
        height: 200px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.7rem;
    }

    .section-tag {
        font-size: 0.8rem;
    }

    /* Expertise */
    .expertise-card {
        padding: 1.5rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
    }

    /* Terminal */
    .terminal-content {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .terminal-line {
        flex-direction: column;
        gap: 0.5rem;
    }

    .skills-list {
        padding-right: 1rem;
    }

    .skills-chip-list {
        padding-right: 1rem;
    }

    /* Tools */
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tool-icon {
        width: 60px;
        height: 60px;
    }

    /* Projects */
    .project-image {
        height: 180px;
    }

    .project-badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }

    .project-content {
        padding: 1.2rem;
    }

    /* Contact Form */
    .contact-form {
        padding: 1.5rem;
    }

    .btn-submit {
        font-size: 1rem;
    }

    /* Newsletter */
    .newsletter-box {
        padding: 1.5rem;
    }

    .newsletter-title {
        font-size: 1.7rem;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 900px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 6rem 0 3rem;
    }

    .profile-container {
        width: 200px;
        height: 200px;
    }

    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== LARGE DESKTOP (> 1400px) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }

    .hero-name {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3.5rem;
    }

    .expertise-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide interactive elements */
    .navbar,
    .scroll-indicator,
    .back-to-top,
    .matrix-bg,
    .particle-canvas,
    .cyber-grid,
    .newsletter-section {
        display: none !important;
    }

    /* Adjust colors for print */
    body {
        background: white;
        color: black;
    }

    /* Remove animations */
    * {
        animation: none !important;
        transition: none !important;
    }

    /* Optimize spacing */
    section {
        padding: 2rem 0;
        page-break-inside: avoid;
    }

    .hero-section {
        min-height: auto;
    }
}

/* ===== ACCESSIBILITY - REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .matrix-bg,
    .particle-canvas {
        display: none;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --neon-green: #00ff00;
        --neon-blue: #00ffff;
        --text-primary: #ffffff;
        --bg-primary: #000000;
    }

    .expertise-card,
    .project-card,
    .article-card {
        border-width: 2px;
    }
}

/* ===== DARK MODE (System Preference) ===== */
@media (prefers-color-scheme: light) {
    /* Keep dark theme as default for cyberpunk aesthetic */
    /* Add light mode toggle via JS if needed */
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .nav-link,
    .btn-neon,
    .social-link,
    .tool-icon {
        min-width: 44px;
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .expertise-card:hover,
    .project-card:hover,
    .article-card:hover {
        transform: none;
    }

    /* Simplify interactions */
    .glitch:hover {
        animation: none;
    }
}

/* ===== RETINA DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .expertise-card,
    .project-card,
    .article-card {
        border-width: 0.5px;
        margin-top: 31px;
    }

    /* Optimize images */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== UTILITY CLASSES FOR RESPONSIVE ===== */

/* Hide on Mobile */
.hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on Mobile */
.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }
}

/* Hide on Tablet */
.hide-tablet {
    display: block;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on Desktop */
.hide-desktop {
    display: block;
}

@media (min-width: 1025px) {
    .hide-desktop {
        display: none !important;
    }
}
