/* ===================================
   RESPONSIVE DESIGN - MOBILE FIRST
   =================================== */

/* ===================================
   TABLET (768px and up)
   =================================== */

@media (max-width: 1024px) {
    :root {
        --spacing-xl: 4rem;
        --spacing-lg: 2.5rem;
    }

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

    /* Navigation */
    .nav-menu {
        gap: 1.5rem;
    }

    /* Hero Section */
    .hero-name {
        font-size: clamp(2rem, 6vw, 4rem);
    }

    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

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

    /* Skills Section */
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

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

    .timeline-item {
        grid-template-columns: auto 1fr;
        gap: var(--spacing-md);
    }

    .timeline-item:nth-child(even) .timeline-date,
    .timeline-item:nth-child(odd) .timeline-date {
        display: none;
    }

    .timeline-item:nth-child(even) .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content {
        grid-column: 2;
    }

    .timeline-dot {
        grid-column: 1;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

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

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

/* ===================================
   MOBILE (768px and below)
   =================================== */

@media (max-width: 768px) {
    :root {
        --spacing-xl: 3rem;
        --spacing-lg: 2rem;
        --spacing-md: 1.5rem;
    }

    /* Navigation */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--color-bg-card);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem;
        gap: 2rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

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

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

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

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

    /* Hero Section */
    .hero-section {
        min-height: calc(100vh - 60px);
        padding-top: 60px;
    }

    .hero-name {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .hero-tagline {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }

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

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

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

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

    .scroll-indicator {
        bottom: 10px;
    }

    /* About Section */
    .about-content {
        gap: var(--spacing-md);
    }

    .image-wrapper {
        width: 200px;
        height: 200px;
    }

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

    .achievements {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .achievement-number {
        font-size: 2.5rem;
    }

    /* Skills Section */
    .skill-category {
        padding: var(--spacing-md);
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

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

    /* Timeline */
    .timeline {
        padding-left: 40px;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        grid-template-columns: auto 1fr;
        margin-bottom: var(--spacing-md);
    }

    .timeline-dot {
        width: 15px;
        height: 15px;
    }

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

    .timeline-card h3 {
        font-size: 1.3rem;
    }

    .tech-tags {
        gap: 0.5rem;
    }

    .tech-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .project-card {
        height: 350px;
    }

    .project-front,
    .project-back {
        padding: var(--spacing-md);
    }

    .project-image {
        width: 100px;
        height: 100px;
    }

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

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

    /* Education */
    .education-card {
        padding: var(--spacing-md);
    }

    .edu-icon {
        width: 60px;
        height: 60px;
    }

    .edu-icon i {
        font-size: 2rem;
    }

    .education-card h3 {
        font-size: 1.3rem;
    }

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

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

    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .contact-item i {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .contact-form {
        padding: var(--spacing-md);
    }

    .form-group {
        margin-bottom: var(--spacing-md);
    }

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

    .back-to-top {
        position: fixed;
        bottom: 20px;
        right: 20px;
    }
}

/* ===================================
   SMALL MOBILE (480px and below)
   =================================== */

@media (max-width: 480px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
        --spacing-md: 1rem;
    }

    .section {
        padding: var(--spacing-lg) 0;
    }

    .container {
        padding: 0 1rem;
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    /* Navigation */
    .logo {
        font-size: 1.5rem;
    }

    .nav-menu {
        width: 85%;
        padding: 4rem 1.5rem;
    }

    /* Hero */
    .hero-name {
        font-size: clamp(1.5rem, 10vw, 2.5rem);
    }

    .hero-tagline {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
    }

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

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    /* About */
    .image-wrapper {
        width: 180px;
        height: 180px;
    }

    .about-subtitle {
        font-size: 1.3rem;
    }

    .about-description {
        font-size: 0.95rem;
    }

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

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

    /* Skills */
    .category-header h3 {
        font-size: 1.3rem;
    }

    .category-header i {
        font-size: 1.5rem;
    }

    .skill-card i {
        font-size: 2rem;
    }

    .skill-card h4 {
        font-size: 1rem;
    }

    /* Timeline */
    .timeline {
        padding-left: 30px;
    }

    .timeline-card h3 {
        font-size: 1.2rem;
    }

    .timeline-card h4 {
        font-size: 1rem;
    }

    .timeline-achievements li {
        font-size: 0.9rem;
    }

    /* Projects */
    .project-card {
        height: 320px;
    }

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

    .project-category {
        font-size: 0.85rem;
    }

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

    /* Education */
    .education-card h3 {
        font-size: 1.2rem;
    }

    .education-card h4 {
        font-size: 1rem;
    }

    .edu-description {
        font-size: 0.9rem;
    }

    /* Contact */
    .contact-info h3 {
        font-size: 1.3rem;
    }

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

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

/* ===================================
   LANDSCAPE ORIENTATION
   =================================== */

@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: 2rem 0;
    }

    .scroll-indicator {
        display: none;
    }

    .section {
        padding: 2rem 0;
    }
}

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

@media print {
    .navbar,
    .hero-socials,
    .scroll-indicator,
    .contact-form,
    .back-to-top,
    .hamburger {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }
}

/* ===================================
   HIGH RESOLUTION DISPLAYS
   =================================== */

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

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

    .hero-name {
        font-size: 6rem;
    }
}

/* ===================================
   TOUCH DEVICE OPTIMIZATIONS
   =================================== */

@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets for touch devices */
    .btn {
        min-height: 48px;
    }

    .nav-link {
        padding: 1rem 0;
    }

    .social-link {
        width: 55px;
        height: 55px;
    }

    /* Disable hover effects on touch */
    .skill-card:hover,
    .project-card:hover .project-inner,
    .education-card:hover,
    .timeline-card:hover {
        transform: none;
    }

    /* Make flip cards tap-activated instead of hover */
    .project-card.active .project-inner {
        transform: rotateY(180deg);
    }
}

/* ===================================
   DARK MODE (User Preference)
   =================================== */

@media (prefers-color-scheme: dark) {
    /* Already using dark theme as default */
}

/* ===================================
   ACCESSIBILITY - HIGH CONTRAST
   =================================== */

@media (prefers-contrast: high) {
    :root {
        --color-primary: #00ffff;
        --color-secondary: #00ff00;
        --color-text-secondary: #ffffff;
    }

    .btn {
        border: 3px solid var(--color-primary);
    }

    .skill-card,
    .timeline-card,
    .project-card,
    .education-card {
        border-width: 3px;
    }
}
