/* ========== Responsive Styles ========== */

/* ========== Tablet (820px and below) ========== */
@media (max-width: 820px) {
    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

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

    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

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

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

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

    /* Navigation gap for 6 links */
    .nav-menu {
        gap: 1.25rem;
    }

    /* Section Title */
    .section-title {
        font-size: 2rem;
    }

    /* Timeline */
    .timeline::before {
        left: 2rem;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding-left: 4rem;
        padding-right: 0;
    }

    .timeline-item:nth-child(odd) .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: calc(2rem - 8px);
        right: auto;
    }

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

    /* Spacing */
    section {
        padding: var(--spacing-lg) 0;
    }
}

/* ========== Mobile (576px and below) ========== */
@media (max-width: 576px) {
    /* Navigation */
    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--header-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
    }

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

    .nav-menu li {
        padding: 1rem 0;
    }

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

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

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

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Theme toggle positioning */
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Hero Section */
    .hero {
        padding: var(--spacing-lg) var(--spacing-sm);
        min-height: 100vh;
    }

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

    .hero-subtitle {
        font-size: 1.125rem;
    }

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

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .scroll-down {
        bottom: 1rem;
    }

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

    /* Section Title */
    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* About Section */
    .about-image img {
        width: 200px;
        height: 200px;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }

    .about-info {
        margin-top: var(--spacing-sm);
    }

    .info-item {
        font-size: 0.9375rem;
    }

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

    .project-card {
        margin-bottom: var(--spacing-sm);
    }

    .project-content {
        padding: var(--spacing-sm);
    }

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

    .project-description {
        font-size: 0.9375rem;
    }

    .project-links {
        flex-direction: column;
    }

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

    .skill-category {
        padding: var(--spacing-sm);
    }

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

    .skill-items {
        grid-template-columns: 1fr;
    }

    .skill-item {
        padding: 0.75rem;
    }

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

    /* Timeline compact */
    .timeline::before {
        left: 1.5rem;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 3.5rem;
    }

    .timeline-item:nth-child(odd) .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: calc(1.5rem - 8px);
    }

    .timeline-content {
        padding: var(--spacing-sm);
    }

    .timeline-content h3 {
        font-size: 1.1rem;
    }

    .contact-info h3 {
        font-size: 1.5rem;
    }

    .contact-info p {
        font-size: 0.9375rem;
    }

    .contact-details {
        gap: var(--spacing-sm);
    }

    .contact-item {
        font-size: 0.9375rem;
    }

    .contact-item i {
        font-size: 1.25rem;
    }

    .social-links {
        justify-content: flex-start;
        margin-top: var(--spacing-sm);
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .footer-content p {
        font-size: 0.875rem;
    }

    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    /* Spacing */
    section {
        padding: var(--spacing-md) 0;
    }

    :root {
        --spacing-xs: 0.25rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1.5rem;
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }
}

/* ========== Extra Small Mobile (420px and below) ========== */
@media (max-width: 420px) {
    .hero-title {
        font-size: 1.75rem;
    }

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

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

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }

    .about-image img {
        width: 180px;
        height: 180px;
    }

    .timeline-content h3 {
        font-size: 1rem;
    }

    .timeline-content .timeline-company,
    .timeline-content .timeline-date {
        font-size: 0.8125rem;
    }

    .project-image .image-placeholder {
        height: 180px;
    }

    .project-image .image-placeholder i {
        font-size: 3rem;
    }
}

/* ========== Landscape Mode for Mobile ========== */
@media (max-width: 820px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .scroll-down {
        display: none;
    }

    .nav-menu {
        top: 60px;
    }
}

/* ========== Print Styles ========== */
@media print {
    .navbar,
    .hamburger,
    .scroll-down,
    .scroll-top,
    .hero-buttons,
    .theme-toggle {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 2rem;
    }

    section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }

    .project-card,
    .skill-category,
    .timeline-item,
    .cert-category {
        page-break-inside: avoid;
    }
}
