/* ============================================
   RESPONSIVE DESIGN - Media Queries
   ============================================ */

/* ============================================
   BREAKPOINTS
   - Desktop: 1200px+
   - Laptop: 992px - 1199px
   - Tablet: 768px - 991px
   - Mobile: < 768px
   ============================================ */

/* ============================================
   TABLET AND BELOW (< 992px)
   ============================================ */

@media (max-width: 991px) {
  /* Typography adjustments */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  
  /* Grid adjustments */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Layout adjustments */
  .two-column,
  .two-column-equal {
    grid-template-columns: 1fr;
  }
  
  .sidebar-layout,
  .sidebar-layout.sidebar-right {
    grid-template-columns: 1fr;
  }
  
  /* Profile section */
  .profile-section {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-image img {
    width: 200px;
    height: 200px;
  }
  
  .profile-links {
    justify-content: center;
  }
  
  /* Section padding */
  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  .hero {
    padding: var(--spacing-2xl) 0;
    min-height: auto;
  }
}

/* ============================================
   MOBILE (< 768px)
   ============================================ */

@media (max-width: 767px) {
  /* Root font size adjustment */
  html {
    font-size: 14px;
  }
  
  /* Typography */
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }
  
  .profile-name {
    font-size: var(--text-3xl);
  }
  
  .profile-title {
    font-size: var(--text-lg);
  }
  
  .profile-bio {
    font-size: var(--text-base);
  }
  
  /* Container padding */
  .container {
    padding: 0 var(--spacing-md);
  }
  
  /* Section spacing */
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  .section-title {
    font-size: var(--text-2xl);
  }
  
  /* Header & Navigation */
  .header-content {
    height: 60px;
  }
  
  .nav-menu {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    background-color: var(--surface-color);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-xl);
    gap: var(--spacing-lg);
    transition: left var(--transition-base);
    box-shadow: var(--shadow-lg);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
  
  .nav-menu a.active::after {
    bottom: -4px;
  }
  
  /* Grid layouts */
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .grid-auto-fit,
  .grid-auto-fill {
    grid-template-columns: 1fr;
  }
  
  .highlights-grid {
    grid-template-columns: 1fr;
  }
  
  .three-column {
    grid-template-columns: 1fr;
  }
  
  /* Profile section */
  .profile-image img {
    width: 150px;
    height: 150px;
  }
  
  .profile-section {
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
  }
  
  /* Cards */
  .card {
    padding: var(--spacing-lg);
  }
  
  .publication-card {
    padding: var(--spacing-md);
  }
  
  /* Buttons */
  .btn {
    width: 100%;
    text-align: center;
  }
  
  .profile-links {
    flex-direction: column;
    width: 100%;
  }
  
  .social-link {
    justify-content: center;
  }
  
  /* Timeline */
  .timeline {
    padding-left: var(--spacing-lg);
  }
  
  .timeline-item::before {
    left: calc(-1 * var(--spacing-lg) - 4px);
    width: 10px;
    height: 10px;
  }
  
  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  /* Card footer stacking */
  .card-footer {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start;
  }
  
  .publication-meta {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
  
  .course-header {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
  
  .course-meta {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
  
  /* Footer */
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-lg);
  }
  
  .footer-left {
    width: 100%;
  }
  
  .footer-links {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .footer-social {
    justify-content: flex-start;
  }
  
  /* Tabs */
  .tabs-nav {
    flex-direction: column;
    gap: 0;
  }
  
  .tab-button {
    width: 100%;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
  }
  
  .tab-button.active {
    border-left: 3px solid var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-left: calc(var(--spacing-lg) - 3px);
  }
  
  /* Filters */
  .filter-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filter-options {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .filter-checkbox {
    width: 100%;
  }
}

/* ============================================
   SMALL MOBILE (< 480px)
   ============================================ */

@media (max-width: 479px) {
  html {
    font-size: 13px;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .profile-image img {
    width: 120px;
    height: 120px;
  }
  
  .section {
    padding: var(--spacing-lg) 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   LARGE DESKTOP (> 1400px)
   ============================================ */

@media (min-width: 1400px) {
  :root {
    --max-width: 1400px;
  }
  
  .grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

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

@media print {
  .header,
  .footer,
  .menu-toggle,
  .btn {
    display: none;
  }
  
  body {
    background-color: white;
    color: black;
  }
  
  .section {
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: underline;
  }
}

/* ============================================
   ACCESSIBILITY - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
