/* ============================================================
   RESPONSIVE DESIGN SYSTEM
   Organized by Breakpoints (Mobile First)
   ============================================================ */

/* 1. SMALL MOBILE DEVICES (Max width: 480px) */
@media only screen and (max-width: 480px) {

    /* Global Adjustments */
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
    }

    .container {
        width: 95%;
        padding: 0 15px;
    }

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

    .section-heading h2,
    .section-title {
        font-size: 1.8rem;
    }

    /* Header & Navigation */
    .logo a {
        font-size: 1.25rem;
    }

    .nav-menu {
        padding: 1.5rem !important;
        top: 60px !important;
        height: calc(100vh - 60px) !important;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.8rem 0 !important;
    }

    /* Hero Section */
    .hero {
        padding: 80px 0 5rem;
        min-height: auto;
    }

    .scroll-down {
        bottom: 1.25rem;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

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

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

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

    .hero-cta {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

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

    .social-links {
        justify-content: center;
        margin-top: 1.5rem;
    }

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

    .hero-image:before {
        width: 220px;
        height: 220px;
    }

    /* AI Chat Component */
    .grok-ai-wrapper {
        padding: 1rem;
    }

    .grok-ai-qa {
        padding: 1.5rem;
    }

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

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

    .grok-suggestions button {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .ai-message {
        max-width: 90%;
        font-size: 0.95rem;
        padding: 0.8rem 1rem;
    }

    .grok-input {
        gap: 8px;
    }

    .grok-input input {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }

    .grok-input button {
        width: 48px;
        height: 48px;
    }

    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        order: -1;
    }

    .about-text h3 {
        font-size: 1.4rem;
        display: block;
        text-align: center;
    }

    .about-text h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .about-details {
        margin-top: 2rem;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .detail-item {
        align-items: center;
    }

    /* Resume & Experience */
    .resume-intro {
        text-align: center;
    }

    .resume-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-preview,
    .btn-download {
        width: 100%;
    }

    .exp-card,
    .education-card {
        padding: 1.25rem;
    }

    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .exp-date {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Projects responsiveness handled in projects.css */

    /* Publications & Certifications */
    .pub-card,
    .cert-card {
        padding: 1.25rem;
    }

    .cert-card {
        flex-direction: column;
        gap: 1rem;
    }

    .cert-icon {
        margin: 0 auto;
    }

    .cert-content {
        text-align: center;
    }

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

    .skill-category {
        padding: 1.25rem;
    }

    .skill-tags {
        justify-content: center;
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .contact-form {
        padding: 1.5rem;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    #scrollToTop {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* 2. TABLET DEVICES (481px to 768px) */
@media only screen and (min-width: 481px) and (max-width: 768px) {
    .container {
        width: 90%;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

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

    .hero-description {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

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

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

    .contact-content {
        grid-template-columns: 1fr;
    }
}

/* 3. SMALL LAPTOPS & TABLETS LANDSCAPE (769px to 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .hero-name {
        font-size: 3rem;
    }

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

/* 4. UTILITY CLASSES FOR RESPONSIVENESS */
.hide-mobile {
    @media (max-width: 768px) {
        display: none !important;
    }
}

.show-mobile {
    @media (min-width: 769px) {
        display: none !important;
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Better Scrolling for Mobile */
body {
    -webkit-overflow-scrolling: touch;
}

/* Animation performance on mobile */
@media (max-width: 768px) {
    * {
        animation-delay: 0s !important;
    }

    .hero-image {
        animation: float 6s ease-in-out infinite;
        /* Slower floating on mobile */
    }
}