/* ========================================
   PSYCLOX PORTFOLIO - RESPONSIVE STYLES
   ======================================== */

/* ========================================
   LARGE DESKTOP (1400px+)
   ======================================== */

@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .title-name {
        font-size: 5rem;
    }

    .hero-image-wrapper {
        width: 450px;
        height: 450px;
    }
}

/* ========================================
   DESKTOP (1200px - 1399px)
   ======================================== */

@media (max-width: 1399px) {
    .container {
        max-width: 1200px;
    }

    .hero-content {
        gap: var(--space-3xl);
    }

    .title-name {
        font-size: 3.5rem;
    }
}

/* ========================================
   SMALL DESKTOP / LARGE TABLET (992px - 1199px)
   ======================================== */

@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

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

    .skills-grid .skill-category:last-child {
        grid-column: span 2;
    }

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

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

    .project-card.featured {
        grid-column: span 2;
        grid-template-columns: 1fr;
    }

    .project-card.featured .project-image {
        min-height: 250px;
    }
}

/* ========================================
   TABLET (768px - 991px)
   ======================================== */

@media (max-width: 991px) {
    :root {
        font-size: 15px;
    }

    html,
    body {
        overflow-x: hidden;
    }

    .container {
        max-width: 720px;
        padding: 0 var(--space-lg);
    }

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

    .nav-toggle {
        display: flex;
        z-index: calc(var(--z-overlay) + 10);
        padding: 12px;
        -webkit-tap-highlight-color: transparent;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 24px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .nav-toggle.active .hamburger {
        background: transparent;
    }

    .nav-toggle.active .hamburger::before {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active .hamburger::after {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hamburger {
        width: 100%;
        height: 2px;
        background: var(--text-dark);
        position: relative;
        transition: all 0.3s ease;
    }

    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 2px;
        background: var(--text-dark);
        transition: all 0.3s ease;
    }

    .hamburger::before {
        top: -8px;
    }

    .hamburger::after {
        top: 8px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        margin-left: auto;
        margin-right: var(--space-md);
    }

    /* Hero */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-2xl);
    }

    .hero-left {
        order: 1;
    }

    .hero-right {
        order: 2;
        max-width: 100%;
    }

    .hero-image-wrapper {
        width: 300px;
        height: 300px;
    }

    .hero-badge {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: 0 auto var(--space-lg) auto !important;
        justify-content: center;
        display: inline-flex;
        width: auto;
    }

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

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

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

    .title-name {
        font-size: 3rem;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        text-align: center;
    }

    .about-image-wrapper {
        width: 280px;
        width: 250px;
        height: 280px;
    }

    .about-hologram {
        display: none !important;
    }

    .floating-badge {
        display: none;
    }

    .about-text {
        max-width: 100%;
    }

    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid .skill-category:last-child {
        grid-column: span 1;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card.featured {
        grid-column: span 1;
    }

    /* Certifications */
    .certs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

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

    /* Section Headers */
    .section-title {
        font-size: 2.5rem;
    }
}

/* ========================================
   LARGE MOBILE (576px - 767px)
   ======================================== */

@media (max-width: 767px) {
    :root {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Header */
    .header {
        padding: var(--space-md) 0;
    }

    /* Hero */
    .hero {
        padding: var(--space-3xl) 0;
        min-height: 100svh;
    }

    .hero-image-wrapper {
        width: 250px;
        height: 250px;
    }

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

    .title-name {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
        flex-direction: column;
        gap: var(--space-xs);
        flex-wrap: wrap;
        /* Allow wrapping */
        word-break: break-word;
    }

    #typewriter {
        white-space: normal;
        /* Allow wrapping */
        display: inline-block;
    }

    .subtitle-dynamic {
        min-width: auto;
    }

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

    .hero-cta {
        flex-direction: column;
        gap: var(--space-md);
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .scroll-indicator {
        bottom: var(--space-lg);
    }

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

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

    /* Timeline */
    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    .timeline-marker {
        left: 0;
    }

    /* Certifications */
    .certs-grid {
        grid-template-columns: 1fr;
    }

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

    /* Contact */
    .contact-info {
        grid-template-columns: 1fr;
    }

    /* Section spacing */
    .about,
    .skills,
    .projects,
    .experience,
    .education,
    .certifications,
    .contact {
        padding: var(--space-3xl) 0;
    }

    .section-header {
        margin-bottom: var(--space-2xl);
    }

    .section-title {
        font-size: 2rem;
    }

    /* Mobile menu */
    .mobile-nav-link {
        font-size: 2rem;
    }

    .mobile-nav-link::before {
        left: -40px;
    }
}

/* ========================================
   SMALL MOBILE (< 576px)
   ======================================== */

@media (max-width: 575px) {

    /* Hero */
    .hero-image-wrapper {
        width: 200px;
        height: 200px;
    }

    .hero-orbit {
        inset: -15px;
    }

    .orbit-dot {
        width: 8px;
        height: 8px;
    }

    .title-name {
        font-size: 2rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-md);
    }

    /* About */
    .about-image-wrapper {
        width: 220px;
        height: 260px;
    }

    .about-name {
        font-size: 1.5rem;
    }

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

    /* Tools grid */
    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* Achievements */
    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievement-item {
        display: flex;
        align-items: center;
        gap: var(--space-lg);
        text-align: left;
    }

    .achievement-icon {
        font-size: 2rem;
        margin-bottom: 0;
    }

    /* Education */
    .education-card {
        flex-direction: column;
        text-align: center;
    }

    .education-highlights {
        justify-content: center;
    }

    /* Timeline */
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-tags {
        flex-wrap: wrap;
    }

    /* Contact form */
    .contact-form {
        padding: var(--space-lg);
    }

    /* Mobile menu */
    .mobile-nav-link {
        font-size: 1.75rem;
        padding: var(--space-sm) 0;
    }

    .mobile-nav-link::before {
        display: none;
    }
}

/* ========================================
   VERY SMALL MOBILE (< 375px)
   ======================================== */

@media (max-width: 374px) {
    .title-name {
        font-size: 1.75rem;
    }

    .hero-image-wrapper {
        width: 180px;
        height: 180px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .about-name {
        font-size: 1.25rem;
    }

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

/* ========================================
   DISABLE CURSOR ON TOUCH DEVICES
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    .cursor {
        display: none !important;
    }

    body {
        cursor: auto;
    }

    a,
    button {
        cursor: pointer;
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-2xl) 0;
    }

    .hero-content {
        grid-template-columns: 1fr 1.5fr;
        text-align: left;
    }

    .hero-left {
        order: 0;
    }

    .hero-right {
        order: 0;
    }

    .hero-image-wrapper {
        width: 180px;
        height: 180px;
    }

    .hero-badge {
        justify-content: flex-start;
    }

    .hero-cta {
        flex-direction: row;
        justify-content: flex-start;
    }

    .btn {
        width: auto;
    }

    .hero-socials {
        justify-content: flex-start;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ========================================
   HIGH DPI SCREENS
   ======================================== */

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .hero-grid {
        background-size: 50px 50px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {

    .header,
    .cursor,
    .loader,
    .mobile-menu-overlay,
    .scroll-indicator,
    .hero-bg,
    .section-transition {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .section-dark {
        background: #fff !important;
        color: #000 !important;
    }

    .gradient-text,
    .gradient-text-2 {
        -webkit-text-fill-color: #000 !important;
        color: #000 !important;
    }

    .btn {
        border: 1px solid #000 !important;
        background: none !important;
        color: #000 !important;
    }

    a {
        text-decoration: underline;
    }
}

/* ========================================
   DARK MODE PREFERENCE (for light sections)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Keep design as is - it's already dark-themed */
}

/* ========================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ======================================== */

@media (max-width: 991px) {

    /* Disable heavy animations on mobile */
    .hero-glow {
        animation: none;
        opacity: 0.5;
    }

    .hero-orbit {
        animation-duration: 30s;
    }

    .geometric-shape {
        animation-duration: 8s;
    }

    /* Simplify 3D effects */
    [data-tilt] {
        transform: none !important;
    }

    [data-tilt] .project-content,
    [data-tilt] .project-image {
        transform: none !important;
    }

    /* Reduce blur effects */
    .header.scrolled {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    /* Simplify project visuals */
    .cube {
        animation-duration: 15s;
    }

    /* Remove About Me Animations completely on mobile */
    .about-hologram,
    .radar-container,
    .radar-grid,
    .radar-sweep,
    .radar-target,
    .radar-core {
        display: none !important;
    }
}

/* Further reduce on smaller devices */
@media (max-width: 575px) {
    .hero-orbit {
        display: none;
    }

    .hero-grid {
        opacity: 0.3;
    }

    .cyber-grid,
    .scan-lines {
        display: none;
    }
}

/* ========================================
   MILESTONES HUD RESPONSIVENESS
   ======================================== */
@media (max-width: 768px) {
    .milestone-hud-container {
        gap: 1.5rem;
        margin-top: 2rem;
        padding: 1rem;
    }

    .hud-divider {
        display: none;
    }

    .hud-item {
        flex: 1 1 100%;
        margin-bottom: 1.5rem;
    }

    .hud-item:last-child {
        margin-bottom: 0;
    }

    .hud-value {
        font-size: 2.5rem;
    }
}