/* Responsive Styles */

/* Large Screens (default) */
/* Already defined in forum.css */

/* Medium screens (tablets, 992px and down) */
@media (max-width: 992px) {
  .forum-header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .forum-logo {
    margin-bottom: 15px;
  }
  
  .forum-title {
    margin-bottom: 15px;
  }
  
  .user-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .search-form {
    margin-left: 0;
  }
  
  main.container {
    flex-direction: column;
  }
  
  .forum-content {
    width: 100%;
  }
  
  .forum-sidebar {
    width: 100%;
  }
  
  .thread-list-header {
    display: none; /* Hide headers on smaller screens */
  }
  
  .thread-item {
    flex-direction: column;
  }
  
  .thread-stats, .thread-last-post {
    margin-top: 10px;
    padding: 0;
  }
  
  .post {
    flex-direction: column;
  }
  
  .post-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
  }
  
  .post-author {
    display: flex;
    align-items: center;
    text-align: left;
  }
  
  .author-avatar {
    margin-right: 15px;
    margin-bottom: 0;
  }
  
  .author-avatar img {
    width: 60px;
    height: 60px;
  }
  
  .profile-header {
    flex-direction: column;
  }
  
  .profile-avatar {
    margin-right: 0;
    margin-bottom: 20px;
    text-align: center;
  }
}

/* Small screens (mobile phones, 576px and down) */
@media (max-width: 576px) {
  .forum-logo {
    display: none; /* Hide logo on very small screens */
  }
  
  .nav-links {
    flex-wrap: wrap;
  }
  
  .nav-links li {
    margin-right: 10px;
  }
  
  .thread-title a {
    white-space: normal; /* Allow thread titles to wrap */
  }
  
  .thread-item {
    padding: 10px 15px;
  }
  
  .post-content {
    padding: 10px;
  }
  
  .search-options {
    flex-direction: column;
    gap: 10px;
  }
  
  .tab-button {
    padding: 10px;
    font-size: 14px;
  }
  
  .result-meta {
    flex-direction: column;
    gap: 5px;
  }
  
  .thread-controls {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .pagination {
    margin-top: 10px;
  }
  
  .author-info {
    display: none; /* Hide author info on very small screens to save space */
  }
  
  .post-meta {
    flex-direction: column;
    gap: 5px;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

/* Landscape phones and portrait tablets */
@media (max-width: 768px) {
  .thread-title {
    flex: 1;
  }
  
  .thread-stats, .thread-last-post {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  
  .forum-section {
    margin-bottom: 15px;
  }
  
  .search-input-container {
    flex-direction: column;
  }
  
  .search-input-container input {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  }
  
  .search-button {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
  }
}

/* High-DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize images for high-DPI screens if needed */
  .forum-logo img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Print styles */
@media print {
  .forum-header, .forum-nav, .forum-sidebar, .breadcrumbs, .thread-controls, 
  .post-footer, .pagination, .forum-footer {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  a {
    color: #000;
    text-decoration: none;
  }
  
  .post {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 20pt;
  }
  
  .post-sidebar {
    width: 20%;
  }
  
  .author-avatar img {
    width: 50pt;
    height: 50pt;
  }
  
  .post-content {
    width: 80%;
  }
  
  /* Add URL after links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 80%;
    color: #666;
  }
  
  /* Don't show URL for internal links */
  a[href^="/"]:after {
    content: "";
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #4285f4;
    --primary-hover: #5a95f5;
    --secondary-color: #1f1f1f;
    --border-color: #444;
    --text-color: #eee;
    --muted-text: #bbb;
    --light-text: #888;
    --link-color: #4285f4;
    --link-hover: #5a95f5;
    --success-color: #34a853;
    --warning-color: #fbbc05;
    --danger-color: #ea4335;
    --background-color: #2d2d2d;
    --alt-background: #1f1f1f;
    --header-background: #1f1f1f;
    --header-text: #fff;
  }
  
  body {
    background-color: #252525;
  }
  
  .forum-nav {
    background-color: #1a1a1a;
  }
  
  .section-header, .thread-list-header, .post-sidebar, .search-result, .post-header {
    background-color: #222;
  }
  
  .thread-item.pinned {
    background-color: #1a2e4d;
  }
  
  .thread-item:hover {
    background-color: #333;
  }
  
  .thread-locked-notice {
    background-color: #3d2626;
    border-color: #5c3a3a;
  }
  
  .post-body blockquote, .no-results, .search-option label {
    background-color: #222;
  }
  
  .btn {
    background-color: #444;
    border-color: #555;
    color: #eee;
  }
  
  .btn:hover {
    background-color: #555;
  }
  
  .pagination .page-link {
    background-color: #333;
    border-color: #444;
    color: #eee;
  }
  
  .pagination .page-link:hover {
    background-color: #444;
  }
  
  .ioc {
    background-color: #1a2e4d;
    border-color: #2a4366;
    color: #80adf7;
  }
  
  .ioc[data-type="hash"] {
    background-color: #4d4000;
    border-color: #665500;
    color: #fbbc05;
  }
  
  .ioc[data-type="url"], .ioc[data-type="domain"] {
    background-color: #133313;
    border-color: #1c461c;
    color: #34a853;
  }
  
  .ioc[data-type="ip"] {
    background-color: #2b1a40;
    border-color: #3d2659;
    color: #af8edb;
  }
  
  .highlight {
    background-color: #453a00;
    color: #f5d742;
  }
  
  input, select, textarea {
    background-color: #333;
    border-color: #444;
    color: #eee;
  }
  
  ::placeholder {
    color: #888;
  }
}
