/* ==========================================
   RESPONSIVE STYLES - MOBILE & TABLET
   ========================================== */

/* ==================== MOBILE (< 768px) ==================== */
@media screen and (max-width: 767px) {
    /* Typography Adjustments */
    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 1.1rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
        line-height: 1.5;
    }

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

    /* Index Header */
    .index-header {
        padding: 0.75rem 1rem;
        top: 10px;
        left: 10px;
    }

    .header-logo-img {
        width: 32px;
        height: 32px;
    }

    .header-logo-text {
        font-size: 1rem;
    }

    /* Profile Image */
    .profile-image {
        width: 100px;
        height: 100px;
    }

    /* Navigation - Mobile Menu */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background-color: var(--primary-blue);
        flex-direction: column;
        padding: var(--spacing-xxl) var(--spacing-lg);
        gap: var(--spacing-md);
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
        z-index: 1001;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link::after {
        display: none;
    }

    /* Guide Page - Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .portfolio-card {
        padding: 1.5rem;
    }

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

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

    /* Guide Page - Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

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

    .stat-label {
        font-size: 0.85rem;
    }

    /* Alignment Page - Requirement Cards */
    .requirement-card {
        padding: 1.5rem;
    }

    .requirement-header h3 {
        font-size: 1.1rem;
    }

    .experience-match {
        padding: 1rem;
    }

    .match-header h4 {
        font-size: 1rem;
    }

    /* Resume Compact - Two Column Layout */
    .resume-page {
        padding: 1rem;
    }

    .two-column {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .summary p {
        font-size: 0.85rem;
    }

    /* Resume Compact - Navigation */
    .nav-header .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .page-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
    }

    .btn-print,
    .btn-full,
    .btn-back,
    .btn-download,
    .btn-compact {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    /* Timeline - Single Column */
    .timeline::before {
        left: 0;
        transform: none;
    }

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

    .timeline-marker {
        left: 0;
        transform: translateX(-50%);
    }

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

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

    /* Education Grid - Single Column */
    .education-grid {
        grid-template-columns: 1fr;
    }

    /* Contact Methods - Single Column */
    .contact-methods {
        grid-template-columns: 1fr;
    }

    /* Hero CTA - Stack Vertically */
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }

    /* Hero Section - Ensure profile image clears navbar */
    .hero-section {
        padding-top: 120px;
        padding-bottom: 3rem;
    }

    /* Section Padding Reduction */
    .content-section {
        padding: var(--spacing-xl) 0;
    }

    /* Container Padding Reduction */
    .container {
        padding: 0 var(--spacing-sm);
    }
}

/* ==================== TABLET (768px - 1023px) ==================== */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    /* Hero Section - Ensure profile image clears navbar */
    .hero-section {
        padding-top: 140px;
    }

    /* Typography Adjustments */
    .hero-name {
        font-size: 3rem;
    }

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

    /* Timeline - Maintain Center Line */
    .timeline::before {
        left: 50%;
    }

    .timeline-item {
        padding-left: calc(50% + 40px);
    }

    .timeline-marker {
        left: 50%;
    }

    /* Projects Grid - 2 Columns */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Skills Grid - 2 Columns */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Education Grid - 2 Columns */
    .education-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact Methods - 2 Columns for First Two, Full Width for Third */
    .contact-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== DESKTOP (1024px+) ==================== */
@media screen and (min-width: 1024px) {
    /* Projects Grid - 3 Columns */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Timeline - Alternating Layout */
    .timeline-item:nth-child(even) {
        padding-left: 0;
        padding-right: calc(50% + 40px);
        text-align: right;
    }

    .timeline-item:nth-child(even) .timeline-content {
        direction: ltr;
    }

    .timeline-item:nth-child(even) .achievements {
        text-align: left;
    }
}

/* ==================== LARGE DESKTOP (1440px+) ==================== */
@media screen and (min-width: 1440px) {
    .hero-name {
        font-size: 4rem;
    }

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

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

/* ==================== HAMBURGER MENU ANIMATION ==================== */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==================== TOUCH DEVICE OPTIMIZATIONS ==================== */
@media (hover: none) and (pointer: coarse) {
    /* Increase Touch Targets */
    .nav-link {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .btn {
        min-height: 48px;
        min-width: 48px;
    }

    /* Remove Hover Effects on Touch Devices */
    .project-card:hover {
        transform: none;
    }

    .project-overlay {
        opacity: 1;
        background-color: rgba(44, 62, 80, 0.7);
    }

    .skill-tag:hover {
        transform: none;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}
