/* Mobile-First Responsive Styles */

/* Base mobile styles (320px - 767px) */
@media (max-width: 767px) {
  
  /* Typography improvements for mobile */
  :root {
    --text-xs: 0.875rem;  /* 14px */
    --text-sm: 1rem;      /* 16px */
    --text-md: 1.125rem;  /* 18px */
    --text-lg: 1.25rem;   /* 20px */
    --text-xl: 1.5rem;    /* 24px */
    --text-2xl: 1.75rem;  /* 28px */
    --text-3xl: 2rem;     /* 32px */
    --text-4xl: 2.25rem;  /* 36px */
  }
  
  /* Increase base font size for better readability */
  html {
    font-size: 18px;
  }
  
  body {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  /* Navigation improvements - always show as "scrolled" state on mobile */
  nav-header {
    position: sticky;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Apply scrolled state styles by default on mobile */
    background: var(--nav-bg-scrolled) !important;
    border-bottom-color: var(--nav-border-scrolled) !important;
  }
  
  .nav-container {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }
  
  .nav-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  
  .nav-brand {
    display: none !important; /* Hide brand text on mobile */
  }
  
  .nav-profile {
    display: flex !important; /* Show profile on mobile instead of brand text */
  }
  
  .nav-profile-image {
    width: 40px !important;
    height: 40px !important;
  }
  
  .nav-profile-info {
    display: flex !important; /* Show profile info on mobile */
  }
  
  /* Hide the main header profile section on mobile */
  .section-header .profile-info {
    display: none !important;
  }
  
  .section-header .contact-links {
    display: none !important;
  }
  
  .nav-menu {
    display: flex !important; /* Show simplified menu on mobile */
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
  }
  
  .nav-menu li {
    display: none; /* Hide most menu items */
  }
  
  /* Show only essential nav items on mobile */
  .nav-menu li:first-child,  /* Home */
  .nav-menu li:last-child {  /* Projects */
    display: block;
  }
  
  .nav-menu .nav-link {
    padding: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
  }
  
  .nav-menu .nav-link:hover,
  .nav-menu .nav-link:active {
    background: var(--bg-secondary);
    color: var(--text-primary);
  }
  
  
  .nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
  }
  
  .nav-social-links {
    display: flex !important;
    gap: 0.25rem;
  }
  
  .nav-social-link {
    font-size: 1.2rem;
    padding: 0.4rem;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Main content spacing */
  .main-content {
    padding-top: 4.5rem;
    padding-left: 0;
    padding-right: 0;
  }
  
  section {
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
  }
  
  /* Header/Profile Section */
  .section-header {
    padding: 2rem 1rem;
    text-align: center;
  }
  
  .header-content {
    max-width: 100%;
  }
  
  .profile-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  
  .profile-image {
    width: 120px !important;
    height: 120px !important;
    margin: 0 auto;
  }
  
  .profile-text {
    width: 100%;
  }
  
  .profile-text .name {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }
  
  .profile-text .title {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
  }
  
  .profile-text .location,
  .profile-text .tagline {
    font-size: 1rem;
  }
  
  /* Contact Bar */
  .contact-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .contact-link {
    padding: 0.75rem;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .contact-icon {
    font-size: 1.25rem;
  }
  
  .contact-text {
    display: inline;
  }
  
  /* Professional Summary */
  .section-summary {
    padding: 1.5rem 1rem;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
  }
  
  .summary-content {
    font-size: 1rem;
    line-height: 1.8;
  }
  
  .summary-paragraph {
    margin-bottom: 1rem;
  }
  
  /* Experience Cards */
  .experience-skills-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
  
  .section-experience {
    order: 2; /* Move experience after skills on mobile */
  }
  
  .section-skills {
    order: 1; /* Show skills first on mobile */
    position: static;
    width: 100%;
  }
  
  .current-job {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-subtle);
  }
  
  .job-header {
    margin-bottom: 1rem;
  }
  
  .job-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
  }
  
  .job-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
  
  .job-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  
  .job-meta span::before {
    content: '•';
    margin-right: 0.25rem;
    color: var(--color-primary);
  }
  
  .job-meta span:first-child::before {
    content: '🏢';
  }
  
  .job-meta span:nth-child(2)::before {
    content: '📅';
  }
  
  .job-meta span:last-child::before {
    content: '📍';
  }
  
  .job-summary {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  .achievements {
    padding-left: 1.25rem;
    margin-top: 1rem;
  }
  
  .achievements li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
  }
  
  .tech-stack {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
  }
  
  /* Previous Jobs Grid */
  .jobs-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  experience-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-subtle);
  }
  
  /* Skills Section */
  .skills-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .skill-category {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
  }
  
  .category-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
  }
  
  .skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .skill-tag {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    white-space: nowrap;
  }
  
  /* Projects Section */
  .projects-container {
    padding: 0 1rem;
  }
  
  .project-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .project-card {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
  }
  
  .project-name {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
  }
  
  .project-description {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
  }
  
  .project-links {
    display: flex;
    gap: 0.75rem;
  }
  
  .project-link {
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-decoration: none;
  }
  
  /* Education Section */
  .education-tags {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .education-tag {
    display: block;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  /* Footer */
  .site-footer {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.875rem;
  }
  
  /* PDF Button for mobile */
  .mobile-pdf-button {
    display: block;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    background: var(--color-primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease;
  }
  
  .mobile-pdf-button:active {
    transform: scale(0.95);
  }
  
  /* Hide elements that don't work well on mobile */
  .nav-right {
    gap: 0.5rem;
  }
  
  #download-pdf {
    display: none; /* Hide inline PDF button */
  }
  
  /* Mobile menu toggle - hide by default on desktop */
  .mobile-menu-toggle {
    display: none;
  }
  
  /* Theme switcher on mobile */
  theme-switcher {
    transform: scale(0.9);
  }
}

/* Tablet/Medium screens (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
  /* Navigation improvements - always show as "scrolled" state on mobile */
  nav-header {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Apply scrolled state styles by default on mobile */
    background: var(--nav-bg-scrolled) !important;
    border-bottom-color: var(--nav-border-scrolled) !important;
  }
  
  .nav-brand {
    display: none !important; /* Hide brand text on mobile */
  }
  
  .nav-profile {
    display: flex !important; /* Show profile on mobile instead of brand text */
  }
  
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .nav-container.scrolled .nav-social-links,
  .nav-social-links {
    display: flex !important;
  }
  
  /* Show all menu items on tablets */
  .nav-menu li {
    display: block !important;
  }
  
  .nav-menu {
    display: flex !important;
    gap: 1.25rem;
    font-size: 0.95rem;
  }
  
  /* Hide the main header profile section on tablets/mobile */
  .section-header .profile-info {
    display: none !important;
  }
  
  .section-header .contact-links {
    display: none !important;
  }
}

/* Small tablets (600px - 767px) */
@media (max-width: 767px) and (min-width: 600px) {
  /* Hide Blog and Meetups, keep Home and Projects */
  .nav-menu li:nth-child(2),  /* Blog */
  .nav-menu li:nth-child(3) { /* Meetups */
    display: none;
  }
  
  /* Show fewer social links */
  .nav-social-links a:nth-child(n+3) {
    display: none;
  }
}

/* Small mobile (480px - 600px) */
@media (max-width: 599px) and (min-width: 481px) {
  .nav-container {
    padding: 0.6rem 0.8rem;
  }
  
  /* Hide theme switcher on very small screens */
  theme-switcher {
    display: none;
  }
  
  /* Only show first social link */
  .nav-social-links a:nth-child(n+2) {
    display: none;
  }
  
  .nav-brand {
    font-size: 1rem;
  }
}

/* Very small mobile (320px - 480px) */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }
  
  .nav-container {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  /* Only show GitHub link on very small screens */
  .nav-social-links a:not(:first-child) {
    display: none;
  }
  
  .nav-social-link {
    font-size: 1.1rem;
    padding: 0.3rem;
    min-width: 34px;
    min-height: 34px;
  }
  
  /* Hide theme switcher and PDF button from nav */
  theme-switcher,
  #download-pdf {
    display: none !important;
  }
  
  .nav-brand {
    font-size: 0.95rem;
  }
  
  .contact-links {
    grid-template-columns: 1fr;
  }
  
  section {
    padding: 1.25rem 0.75rem;
  }
  
  .profile-text .name {
    font-size: 1.5rem;
  }
}

/* Ultra small mobile (below 360px) */
@media (max-width: 359px) {
  .nav-container {
    padding: 0.4rem;
    gap: 0.3rem;
  }
  
  .mobile-menu-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .nav-profile-image {
    width: 32px !important;
    height: 32px !important;
  }
  
  .nav-social-link {
    min-width: 32px;
    min-height: 32px;
    font-size: 1rem;
  }
}

/* Landscape mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .section-header {
    padding: 1rem;
  }
  
  .profile-info {
    flex-direction: row;
  }
  
  .profile-image {
    width: 80px !important;
    height: 80px !important;
  }
  
  .contact-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .contact-link,
  .project-link,
  .skill-tag,
  .nav-social-link {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .skill-tag:hover,
  .project-card:hover,
  experience-card:hover {
    transform: none;
  }
}