/*=============== RESPONSIVE DESIGN ===============*/

/* For large devices */
@media screen and (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

/* For medium devices */
@media screen and (max-width: 992px) {
    :root {
        --biggest-font-size: 3rem;
        --h1-font-size: 2.25rem;
        --h2-font-size: 1.75rem;
        --h3-font-size: 1.25rem;
    }

    .container {
        max-width: 720px;
    }

    .hero__container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero__image-wrapper {
        order: -1;
    }

    .hero__image-bg,
    .hero__image {
        width: 300px;
        height: 300px;
    }

    .hero__stats {
        position: static;
        justify-content: center;
        margin-top: 2rem;
    }

    .footer__content {
        grid-template-columns: 1fr 1fr;
    }

    .footer__info {
        grid-column: 1 / -1;
    }
}

/* For small devices */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 3.5rem;
    }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 4rem 0 3rem;
    }

    /* Navigation */
    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--container-color);
        box-shadow: -2px 0 24px rgba(0, 0, 0, 0.15);
        padding: 4rem 2rem;
        transition: right 0.4s;
        z-index: var(--z-fixed);
    }

    .nav__menu.show-menu {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: 2rem;
    }

    .nav__link {
        font-size: 1.125rem;
    }

    .nav__close,
    .nav__toggle {
        display: block;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--title-color);
    }

    .nav__close {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .nav__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding-bottom: 2rem;
    }

    .hero__container {
        gap: 2rem;
    }

    .hero__buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero__social {
        justify-content: center;
    }

    /* About */
    .about__info-grid {
        grid-template-columns: 1fr;
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    /* Projects */
    .project-image {
        height: 200px;
    }

    /* Skills */
    .skills__container {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact__cards {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer__content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer__list {
        align-items: center;
    }

    .footer__bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Scroll up */
    .scrollup {
        right: 1rem;
    }

    .scrollup.show-scroll {
        bottom: 2rem;
    }
}

/* For extra small devices */
@media screen and (max-width: 576px) {
    :root {
        --biggest-font-size: 2.5rem;
        --h1-font-size: 2rem;
        --h2-font-size: 1.5rem;
        --h3-font-size: 1.125rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .hero__image-bg,
    .hero__image {
        width: 250px;
        height: 250px;
    }

    .stat-card {
        min-width: 80px;
        padding: 0.75rem 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .project-tags,
    .tech-tags {
        gap: 0.5rem;
    }

    .tag,
    .tech-tag,
    .project-tech span,
    .skill-items span {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* For very small devices */
@media screen and (max-width: 350px) {
    :root {
        --biggest-font-size: 2rem;
        --h1-font-size: 1.75rem;
        --h2-font-size: 1.25rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    .nav__menu {
        width: 100%;
        padding: 4rem 1.5rem;
    }

    .hero__image-bg,
    .hero__image {
        width: 200px;
        height: 200px;
    }

    .hero__stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .stat-card {
        width: 100%;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }

    .value-card,
    .skill-card,
    .contact-card {
        padding: 1.5rem;
    }
}

/* Landscape mode adjustments */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + 1rem);
        padding-bottom: 2rem;
    }

    .scroll-down {
        display: none;
    }

    .section {
        padding: 3rem 0 2rem;
    }
}

/* Print styles */
@media print {
    .header,
    .nav__toggle,
    .nav__actions,
    .hero__buttons,
    .hero__social,
    .scroll-down,
    .scrollup,
    .project-overlay,
    .contact__social {
        display: none;
    }

    body {
        background-color: #ffffff;
        color: #000000;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --text-color: #000000;
        --title-color: #000000;
        --body-color: #ffffff;
        --container-color: #ffffff;
        --border-color: #000000;
    }

    body.dark-theme {
        --primary-color: #00ffff;
        --text-color: #ffffff;
        --title-color: #ffffff;
        --body-color: #000000;
        --container-color: #000000;
        --border-color: #ffffff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
