/* Desktop Large (1600px+) - Default styles, spacious layout */
@media (min-width: 1600px) {
  .notes-panel {
    width: 360px;
  }
  
  .bookmarks-panel {
    width: 380px;
  }
  
  .timer-widget {
    min-width: 260px;
  }
}

/* Desktop (1200px - 1599px) - Standard desktop */
@media (min-width: 1200px) and (max-width: 1599px) {
  .notes-panel {
    width: 300px;
    left: 15px;
  }
  
  .bookmarks-panel {
    width: 320px;
    right: 15px;
  }
  
  .history-panel {
    width: 300px;
    left: 15px;
  }
}

/* Laptop (992px - 1199px) - Hide side panels, show only essential */
@media (max-width: 1199px) {
  .notes-panel,
  .history-panel,
  .bookmarks-panel {
    display: none;
  }
  
  .timer-widget {
    bottom: 20px;
    right: 20px;
    min-width: 220px;
  }
  
  .calculator-widget {
    bottom: 20px;
    left: 20px;
    transform: none;
    min-width: 220px;
  }
  
  nav {
    padding: 1.25rem 2rem;
  }
  
  .hero h1 {
    font-size: 3.5rem;
  }
  
  .search-container {
    max-width: 650px;
  }
  
  .results-section {
    max-width: 850px;
  }
}

/* Tablet (768px - 991px) - Simplified layout */
@media (max-width: 991px) {
  nav {
    padding: 1rem 1.5rem;
  }
  
  .nav-links {
    gap: 1.5rem;
  }
  
  .nav-links a {
    font-size: 0.8125rem;
  }
  
  .logo-text {
    font-size: 1.35rem;
  }
  
  .clock {
    font-size: 1rem;
  }
  
  .hero {
    padding: 4rem 1.5rem 2.5rem;
  }
  
  .hero h1 {
    font-size: 3rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .search-container {
    max-width: 600px;
    padding: 0 1.5rem;
  }
  
  .search-input {
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
  }
  
  .api-categories {
    gap: 0.625rem;
  }
  
  .api-chip {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
  
  .results-section {
    max-width: 750px;
    padding: 2rem 1.5rem;
  }
  
  .result-card {
    padding: 1.75rem;
  }
  
  .result-title {
    font-size: 1.35rem;
  }
  
  .timer-widget {
    min-width: 200px;
    padding: 1.75rem 1.5rem;
  }
  
  .timer-display {
    font-size: 2.75rem;
  }
  
  .spotify-panel {
    width: 320px;
  }
}

/* Mobile Large (576px - 767px) - Mobile optimized */
@media (max-width: 767px) {
  nav {
    padding: 1rem 1rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-center {
    gap: 1rem;
  }
  
  .logo-text {
    font-size: 1.15rem;
    letter-spacing: 0.08em;
  }
  
  .logo-icon {
    width: 28px;
    height: 28px;
  }
  
  .clock {
    font-size: 0.9rem;
    min-width: 80px;
  }
  
  .dark-mode-toggle {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    margin-left: 0.5rem;
  }
  
  main {
    padding-top: 100px;
  }
  
  .hero {
    padding: 3rem 1rem 2rem;
  }
  
  .hero h1 {
    font-size: 2.5rem;
    letter-spacing: 0.15em;
  }
  
  .hero p {
    font-size: 0.9375rem;
  }
  
  .search-container {
    max-width: 100%;
    padding: 0 1rem;
    margin-top: 2rem;
  }
  
  .search-input {
    padding: 1.125rem 1.25rem;
    padding-right: 3.5rem;
    font-size: 0.9375rem;
    border-radius: 16px;
  }
  
  .search-btn {
    right: 8px;
    padding: 0.75rem;
    border-radius: 12px;
  }
  
  .search-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .api-categories {
    gap: 0.5rem;
    margin-top: 1.5rem;
  }
  
  .api-chip {
    padding: 0.5rem 0.875rem;
    font-size: 0.6875rem;
  }
  
  .results-section {
    max-width: 100%;
    padding: 1.5rem 1rem;
    margin-top: 1.5rem;
  }
  
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .results-header h2 {
    font-size: 1.25rem;
  }
  
  .results-count {
    font-size: 0.8125rem;
  }
  
  .results-grid {
    gap: 1.25rem;
  }
  
  .result-card {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  .result-title {
    font-size: 1.2rem;
  }
  
  .result-excerpt {
    font-size: 0.875rem;
  }
  
  .result-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .result-meta span {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
  }
  
  .bookmark-btn {
    width: 36px;
    height: 36px;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 1rem;
  }
  
  .timer-widget {
    width: calc(100% - 32px);
    left: 16px;
    right: 16px;
    bottom: 16px;
    min-width: auto;
    padding: 1.5rem 1.25rem;
  }
  
  .timer-widget h3 {
    font-size: 1rem;
  }
  
  .timer-display {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
  }
  
  .timer-controls {
    gap: 0.5rem;
  }
  
  .timer-controls button {
    padding: 0.625rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .spotify-tab {
    top: auto;
    bottom: 120px;
    transform: none;
  }
  
  .spotify-toggle {
    padding: 1rem 0.75rem;
  }
  
  .spotify-icon {
    width: 24px;
    height: 24px;
  }
  
  .spotify-panel {
    width: 100%;
    right: -100%;
  }
  
  .empty-state {
    padding: 3rem 1rem;
  }
  
  .empty-state svg {
    width: 72px;
    height: 72px;
  }
  
  .empty-state p {
    font-size: 0.9rem;
  }
  
  footer {
    padding: 3rem 1rem;
  }
  
  .notification {
    width: calc(100% - 40px);
    right: -100%;
    left: auto;
  }
  
  .notification.show {
    right: 20px;
  }
}

/* Mobile Small (375px - 575px) - Compact mobile */
@media (max-width: 575px) {
  .hero h1 {
    font-size: 2.25rem;
  }
  
  .search-input {
    padding: 1rem 1.125rem;
    padding-right: 3.25rem;
  }
  
  .api-chip {
    padding: 0.5rem 0.75rem;
    font-size: 0.65rem;
  }
  
  .result-card {
    padding: 1.25rem;
  }
  
  .result-title {
    font-size: 1.125rem;
  }
  
  .timer-display {
    font-size: 2.25rem;
  }
}

/* Mobile Extra Small (< 375px) - Very compact */
@media (max-width: 374px) {
  .logo-text {
    display: none;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 0.875rem;
  }
  
  .search-container {
    padding: 0 0.75rem;
  }
  
  .api-categories {
    gap: 0.375rem;
  }
  
  .api-chip {
    padding: 0.5rem 0.625rem;
    font-size: 0.625rem;
  }
  
  .result-card {
    padding: 1rem;
  }
  
  .bookmark-btn {
    width: 32px;
    height: 32px;
  }
  
  .timer-widget {
    padding: 1.25rem 1rem;
  }
}

/* Landscape Mobile - Optimize for horizontal space */
@media (max-height: 500px) and (orientation: landscape) {
  nav {
    padding: 0.75rem 1.5rem;
  }
  
  main {
    padding-top: 80px;
  }
  
  .hero {
    padding: 2rem 1rem 1.5rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 0.875rem;
  }
  
  .search-container {
    margin-top: 1.5rem;
  }
  
  .timer-widget {
    bottom: 10px;
    padding: 1rem;
  }
  
  .timer-display {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }
  
  .spotify-tab {
    bottom: 80px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .search-btn,
  .api-chip,
  .result-card,
  .bookmark-btn,
  .timer-controls button,
  .notes-actions button,
  .dark-mode-toggle {
    /* Larger touch targets */
    min-height: 44px;
  }
  
  .api-chip {
    padding: 0.625rem 1rem;
  }
  
  /* Remove hover effects on touch devices */
  .search-btn:hover,
  .api-chip:hover,
  .result-card:hover {
    transform: none;
  }
  
  /* Use active states instead */
  .search-btn:active {
    transform: scale(0.95);
  }
  
  .api-chip:active {
    transform: scale(0.97);
  }
  
  .result-card:active {
    transform: scale(0.99);
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  .crescent-moon {
    stroke-width: 2.25;
  }
}

/* Print Styles */
@media print {
  nav,
  .spotify-tab,
  .spotify-panel,
  .notes-panel,
  .timer-widget,
  .history-panel,
  .bookmarks-panel,
  .dark-mode-toggle,
  .bookmark-btn,
  .orb,
  footer {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .result-card {
    page-break-inside: avoid;
    border: 1px solid #000;
  }
}
