/* =====================================================
   MOBILE RESPONSIVE STYLES - AYUSH SINGH PORTFOLIO
   Comprehensive mobile-first responsive design
   ===================================================== */

/* ==================== GENERAL MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {

    /* Reduce section padding for mobile */
    section {
        padding: 80px 0;
    }

    .section-header {
        margin-bottom: 50px;
    }

    .section-tag {
        padding: 8px 18px;
        font-size: 14px;
    }

    .section-title {
        font-size: clamp(28px, 7vw, 38px);
    }

    .section-description {
        font-size: 16px;
        padding: 0 10px;
        line-height: 1.6;
    }

    .container {
        padding: 0 16px;
    }

    /* Reduce scrollbar size on mobile */
    ::-webkit-scrollbar {
        width: 6px;
    }
}

@media (max-width: 480px) {
    section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .container {
        padding: 0 12px;
    }

    .section-title {
        font-size: clamp(24px, 6.5vw, 32px);
        line-height: 1.3;
    }
}

/* ==================== NAVBAR MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 0;
    }

    .navbar.scrolled {
        padding: 10px 0;
    }

    .nav-container {
        padding: 0 16px;
    }

    .nav-logo .logo-gradient {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .nav-logo .logo-name {
        font-size: 16px;
    }

    .nav-actions {
        gap: 10px;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
    }

    .nav-toggle {
        padding: 6px;
    }

    .nav-toggle span {
        width: 22px;
    }

    /* Hide nav CTA on mobile */
    .nav-cta {
        display: none !important;
    }

    /* Mobile menu improvements */
    .mobile-menu {
        padding: 80px 24px 40px;
    }

    .mobile-nav-link {
        font-size: 26px;
    }

    .mobile-social {
        margin-top: 30px;
    }

    .mobile-social .social-link {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .nav-logo .logo-name {
        font-size: 14px;
    }

    .mobile-nav-link {
        font-size: 22px;
    }
}

/* ==================== HERO SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .hero-section {
        padding: 100px 16px 60px;
        min-height: auto;
    }

    .hero-content {
        text-align: center;
        padding: 0;
    }

    .hero-badge {
        padding: 8px 16px;
        gap: 8px;
        margin-bottom: 24px;
    }

    .hero-badge span:last-child {
        font-size: 14px;
    }

    .hero-title {
        margin-bottom: 20px;
    }

    .title-line {
        font-size: clamp(16px, 4.5vw, 20px);
    }

    .title-name {
        font-size: clamp(36px, 10vw, 56px);
        line-height: 1.15;
    }

    .title-role {
        font-size: clamp(18px, 5vw, 26px);
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-description {
        font-size: 16px;
        margin-bottom: 30px;
        padding: 0 10px;
        line-height: 1.75;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
        padding: 20px 16px;
        width: 100%;
        margin-bottom: 30px;
    }

    .stat-item {
        flex-direction: row;
        gap: 12px;
        width: 100%;
        justify-content: center;
    }

    .stat-number {
        font-size: 28px;
    }

    .stat-label {
        font-size: 14px;
    }

    .stat-divider {
        width: 80px;
        height: 1px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 30px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 15px;
        width: 100%;
    }

    .hero-social {
        gap: 12px;
        justify-content: center;
    }

    .social-link {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    /* Scroll indicator */
    .scroll-indicator {
        bottom: 20px;
        font-size: 11px;
    }

    .mouse {
        width: 20px;
        height: 34px;
    }

    /* Scroll flip card adjustments */
    .scroll-flip-card {
        display: none;
        /* Hide on smaller screens for better performance */
    }

    .hero-image {
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        display: flex !important;
        justify-content: center;
        margin: 30px auto 0;
    }

    .image-wrapper {
        width: 220px;
        height: 280px;
    }

    .flip-card-destination {
        display: block;
        max-width: 100%;
        margin: 0 auto 30px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 90px 12px 50px;
    }

    .title-name {
        font-size: clamp(30px, 9vw, 44px);
    }

    .hero-stats {
        padding: 16px;
        gap: 14px;
    }

    .stat-number {
        font-size: 24px;
    }

    .btn {
        padding: 14px 22px;
        font-size: 14px;
    }
}

/* ==================== ABOUT SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .about-section {
        padding: 70px 0;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        max-width: 280px;
        margin: 0 auto;
        order: -1;
    }

    .flip-card-destination {
        max-width: 100%;
        aspect-ratio: 1/1.1;
    }

    .about-text {
        padding: 0;
        text-align: center;
    }

    .about-intro {
        font-size: 17px;
        line-height: 1.75;
    }

    .about-description {
        font-size: 15px;
        margin-bottom: 24px;
        line-height: 1.7;
    }

    .about-info {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 30px;
    }

    .info-item {
        padding: 14px;
        justify-content: flex-start;
        text-align: left;
    }

    .info-item i {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .info-label {
        font-size: 13px;
    }

    .info-value {
        font-size: 14px;
    }

    .about-actions {
        flex-direction: column;
        gap: 12px;
    }

    .about-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Experience badge */
    .experience-badge {
        width: 80px;
        height: 80px;
        bottom: -15px;
        right: -8px;
    }

    .experience-badge .years {
        font-size: 22px;
    }

    .experience-badge .text {
        font-size: 8px;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    .about-intro {
        font-size: 16px;
    }

    .about-image {
        max-width: 240px;
    }
}

/* ==================== SKILLS SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .skills-section {
        padding: 70px 0;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 50px;
    }

    .skill-category {
        padding: 24px;
    }

    .category-header {
        margin-bottom: 20px;
    }

    .category-header i {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .category-header h3 {
        font-size: 18px;
    }

    .skills-list {
        gap: 16px;
    }

    .skill-item {
        grid-template-columns: 36px 1fr 80px;
        gap: 12px;
    }

    .skill-icon {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .skill-name {
        font-size: 14px;
    }

    .skill-bar {
        height: 5px;
    }

    /* Tech stack */
    .tech-stack {
        padding: 0 10px;
    }

    .tech-label {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .tech-icons {
        gap: 12px;
    }

    .tech-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .tech-icon::after {
        font-size: 12px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .skill-item {
        grid-template-columns: 32px 1fr 70px;
        gap: 10px;
    }

    .skill-icon {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .skill-name {
        font-size: 13px;
    }

    .tech-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

/* ==================== PROJECTS SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .projects-section {
        padding: 70px 0;
    }

    .projects-grid {
        gap: 16px;
        padding: 12px 0 28px;
        margin-bottom: 30px;
    }

    .project-card {
        flex: 0 0 300px;
        min-width: 300px;
    }

    .project-card:first-child {
        margin-left: 16px;
    }

    .project-card:last-child {
        margin-right: 16px;
    }

    .project-card {
        border-radius: 16px;
    }

    .project-image {
        aspect-ratio: 16/9;
    }

    .project-content {
        padding: 20px;
    }

    .project-category {
        font-size: 13px;
        padding: 5px 12px;
    }

    .project-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .project-description {
        font-size: 14px;
        margin-bottom: 16px;
        line-height: 1.7;
    }

    .project-tech {
        gap: 6px;
        margin-bottom: 16px;
    }

    .project-tech span {
        padding: 4px 12px;
        font-size: 13px;
    }

    .project-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .project-btn {
        padding: 10px 16px;
        font-size: 14px;
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }

    .project-link {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .project-card {
        flex: 0 0 280px;
        min-width: 280px;
    }

    .project-content {
        padding: 16px;
    }

    .project-title {
        font-size: 16px;
    }

    .project-btn {
        min-width: 100px;
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ==================== EXPERIENCE/TIMELINE SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .experience-section {
        padding: 70px 0;
    }

    .animated-timeline {
        padding: 30px 0;
        margin-top: 40px;
    }

    .timeline-line {
        left: 25px;
        width: 3px;
    }

    .animated-timeline .timeline-item {
        width: 100%;
        padding: 0 0 40px 70px !important;
        text-align: left !important;
    }

    .animated-timeline .timeline-item.left,
    .animated-timeline .timeline-item.right {
        left: 0;
    }

    .animated-timeline .timeline-item.left .timeline-dot,
    .animated-timeline .timeline-item.right .timeline-dot {
        left: 0;
        right: auto;
    }

    .timeline-dot {
        width: 46px;
        height: 46px;
        border-width: 3px;
    }

    .timeline-dot i {
        font-size: 18px;
    }

    .timeline-card {
        padding: 20px;
        border-radius: 16px;
    }

    .timeline-card .timeline-date {
        font-size: 13px;
        padding: 6px 14px;
        margin-bottom: 14px;
    }

    .timeline-card .timeline-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .timeline-card .timeline-company {
        font-size: 14px;
        margin-bottom: 12px;
        justify-content: flex-start !important;
        flex-wrap: wrap;
    }

    .timeline-card .timeline-description {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 14px;
    }

    .timeline-card .timeline-skills {
        gap: 6px;
        justify-content: flex-start !important;
    }

    .timeline-card .timeline-skills span {
        padding: 5px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .animated-timeline .timeline-item {
        padding-left: 60px !important;
        padding-bottom: 30px;
    }

    .timeline-line {
        left: 20px;
        width: 2px;
    }

    .timeline-dot {
        width: 40px;
        height: 40px;
    }

    .timeline-dot i {
        font-size: 16px;
    }

    .timeline-card {
        padding: 16px;
    }

    .timeline-card .timeline-title {
        font-size: 16px;
    }
}

/* ==================== TESTIMONIALS SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .testimonials-section {
        padding: 70px 0;
    }



    .testimonial-card {
        padding: 24px;
        border-radius: 16px;
    }

    .quote-icon {
        font-size: 36px;
        margin-bottom: 16px;
    }

    .testimonial-text {
        font-size: 15px;
        line-height: 1.75;
        margin-bottom: 20px;
    }

    .testimonial-author {
        gap: 14px;
    }

    .author-avatar {
        width: 42px;
        height: 42px;
        font-size: 14px;
    }

    .author-name {
        font-size: 15px;
    }

    .author-role {
        font-size: 13px;
    }
}

/* ==================== CONTACT SECTION MOBILE ==================== */
@media (max-width: 768px) {
    .contact-section {
        padding: 70px 0;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-info {
        gap: 16px;
    }

    .info-card {
        padding: 20px;
        gap: 16px;
        flex-direction: column;
        text-align: center;
        border-radius: 16px;
    }

    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
        margin: 0 auto;
    }

    .info-details h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .info-details p {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .info-details a {
        font-size: 14px;
        justify-content: center;
    }

    .info-details .social-links {
        justify-content: center;
        gap: 16px;
    }

    .info-details .social-links a {
        font-size: 22px;
    }

    /* Contact form */
    .contact-form-wrapper {
        padding: 24px;
        border-radius: 16px;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .form-group input,
    .form-group textarea {
        padding: 14px 16px;
        font-size: 16px;
    }

    .form-group textarea {
        min-height: 120px;
    }

    .submit-btn {
        padding: 14px;
        font-size: 15px;
    }

    .form-message {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .contact-form-wrapper {
        padding: 20px;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 14px;
    }

    .info-card {
        padding: 16px;
    }
}

/* ==================== FOOTER MOBILE ==================== */
@media (max-width: 768px) {
    .footer {
        padding: 60px 0 30px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        margin-bottom: 40px;
    }

    .footer-logo {
        justify-content: center;
        font-size: 18px;
        margin-bottom: 16px;
    }

    .footer-logo .logo-gradient {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .footer-brand p {
        max-width: 100%;
        font-size: 15px;
        margin: 0 auto;
        line-height: 1.75;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .footer-column h4 {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .footer-column ul li {
        margin-bottom: 10px;
    }

    .footer-column ul li a {
        font-size: 14px;
    }

    .footer-social {
        justify-content: center;
        gap: 10px;
    }

    .footer-social a {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        padding-top: 24px;
        text-align: center;
    }

    .footer-bottom p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 50px 0 24px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom p {
        font-size: 13px;
    }
}

/* ==================== BACK TO TOP BUTTON MOBILE ==================== */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* ==================== AUTH PAGE MOBILE ==================== */
@media (max-width: 768px) {
    .auth-container {
        padding: 20px;
    }

    .auth-card {
        padding: 28px;
        border-radius: 20px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-logo {
        font-size: 28px;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .form-label {
        font-size: 13px;
    }

    .form-input {
        padding: 11px 14px;
        font-size: 15px;
    }

    .auth-btn {
        padding: 12px;
        font-size: 15px;
    }

    .social-login {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .social-btn {
        padding: 11px;
        font-size: 13px;
    }

    .auth-divider {
        margin: 20px 0;
        font-size: 13px;
    }

    .auth-footer {
        font-size: 13px;
    }
}

/* ==================== ADMIN PAGE MOBILE ==================== */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 20px;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .page-header>div:first-child {
        width: 100%;
    }

    .page-title {
        font-size: 24px;
    }

    .page-header>button,
    .page-header>.action-btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .data-card {
        padding: 18px;
        border-radius: 14px;
    }

    .card-title {
        font-size: 16px;
    }

    /* Modal mobile */
    .modal {
        padding: 16px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .modal-content {
        padding: 24px;
        border-radius: 16px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .form-input,
    .form-textarea {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .form-buttons button {
        width: 100%;
    }

    /* Mobile menu toggle for admin */
    .admin-menu-toggle {
        display: block;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 101;
        width: 44px;
        height: 44px;
        background: var(--gradient-primary);
        border: none;
        border-radius: 12px;
        color: white;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding: 16px;
    }

    .page-title {
        font-size: 20px;
    }

    .modal-content {
        padding: 20px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ==================== PAGE HERO (my-projects.html) MOBILE ==================== */
@media (max-width: 768px) {
    .page-hero {
        padding: 120px 0 60px;
    }

    .page-title {
        font-size: clamp(32px, 8vw, 48px);
        margin-bottom: 16px;
    }

    .page-description {
        font-size: 16px;
        padding: 0 10px;
        line-height: 1.75;
    }
}

@media (max-width: 480px) {
    .page-hero {
        padding: 100px 0 50px;
    }

    .page-title {
        font-size: clamp(28px, 7vw, 40px);
    }

    .page-description {
        font-size: 15px;
    }
}

/* ==================== COMMAND PALETTE MOBILE ==================== */
@media (max-width: 768px) {
    .command-btn {
        display: none;
    }
}

/* ==================== TOUCH-FRIENDLY ENHANCEMENTS ==================== */
@media (max-width: 768px) {

    /* Increase tap targets */
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Disable hover effects on touch devices */
    @media (hover: none) {
        .project-card:hover {
            transform: none;
        }

        .timeline-card:hover {
            transform: none;
        }

        .testimonial-card:hover {
            transform: none;
        }

        .skill-category:hover {
            transform: none;
        }

        .info-card:hover {
            transform: none;
        }

        .tech-icon:hover {
            transform: none;
        }

        .btn-primary:hover {
            transform: none;
        }

        .btn-outline:hover {
            transform: none;
        }
    }
}

/* ==================== LANDSCAPE MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 100px 24px 60px;
    }

    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .stat-divider {
        width: 1px;
        height: 40px;
    }

    .about-content {
        gap: 30px;
    }

    .about-image {
        max-width: 200px;
    }
}

/* ==================== PRELOADER MOBILE ==================== */
@media (max-width: 768px) {
    .preloader-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .logo-text {
        font-size: 22px;
    }

    .preloader-text {
        font-size: 13px;
    }
}

/* ==================== SCROLL PROGRESS MOBILE ==================== */
@media (max-width: 768px) {
    .scroll-progress {
        height: 2px;
    }
}

/* ==================== iOS SPECIFIC FIXES ==================== */
@supports (-webkit-touch-callout: none) {

    /* iOS-specific styles */
    .hero-section {
        min-height: -webkit-fill-available;
    }

    .mobile-menu {
        height: -webkit-fill-available;
    }

    /* Fix iOS input zoom */
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ==================== SAFE AREA INSETS (Notch Support) ==================== */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .mobile-menu {
        padding-top: max(80px, calc(60px + env(safe-area-inset-top)));
    }

    .footer {
        padding-bottom: max(30px, env(safe-area-inset-bottom));
    }

    .back-to-top {
        bottom: max(20px, env(safe-area-inset-bottom));
        right: max(20px, env(safe-area-inset-right));
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    .scroll-flip-card {
        display: none;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}