/* Mobile Responsive CSS - Shared across all pages */

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .top-nav {
    padding: 0.5rem 1rem !important;
    flex-direction: row !important;
    gap: 0.25rem !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .top-nav img {
    height: 32px;
  }

  .nav-center h1 {
    font-size: 1rem !important;
  }

  .nav-left, .nav-right {
    gap: 8px;
  }

  .nav-right a {
    margin-left: 0.5rem;
    font-size: 0.9rem;
  }

  #user-info {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .main-nav {
    flex-wrap: wrap !important;
    gap: 0 !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  .main-nav a {
    padding: 0 !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
  }

  .container {
    flex-direction: column !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .left-space, .right-space {
    display: none;
  }

  .left, .right {
    width: 100% !important;
    padding: 0 !important;
  }

  .left {
    order: 1 !important;
  }

  .right {
    order: 2;
  }

  h2 {
    font-size: 1rem !important;
    padding-bottom: 0.3rem !important;
    padding-top: 0.3rem !important;
    padding-left: 0.5rem !important;
  }

  .section {
    margin-bottom: 1rem;
  }

  .section ul li {
    font-size: 0.85rem;
    padding: 8px 0;
    text-align: left !important;
    border-bottom: 1px solid #eee;
  }

  .section ul li a {
    display: block;
    text-decoration: none;
    color: #0C2340;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
  }

  .section ul li .post-meta {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .section ul li .post-meta span {
    white-space: nowrap;
  }

  .category-tag {
    font-size: 0.7rem;
    padding: 2px 4px;
  }

  /* Mobile table to list conversion */
  .table-container {
    overflow-x: auto;
    padding: 0 1rem 1rem !important;
  }

  .table-container table {
    width: 100%;
    border-collapse: collapse;
  }

  .table-container table thead {
    display: none;
  }

  .table-container table tbody tr {
    /* display: block; */
    /* border: 1px solid #ddd; */
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    /* box-shadow: 0 1px 3px rgba(0,0,0,0.1); */
    border-bottom: 1px solid #ddd;
  }

  .table-container table tbody td {
    display: block;
    border: none;
    padding: 4px 0;
    text-align: left !important;
  }

  .table-container table tbody td:first-child {
    font-weight: 600;
    font-size: 0.85rem;
    color: #666;
    display: block;
    margin-right: 8px;
    width: auto;
  }

  .table-container table tbody td:nth-child(2) {
    font-size: 0.75rem;
    line-height: 1.4;
    /* margin-bottom: 6px; */
    display: inline-block;
    /* width: calc(100% - 40px); */
    margin-right: 8px;
    color: #666;
    text-align: left !important;
  }

  .table-container table tbody td:nth-child(2) a {
    color: #0C2340;
    text-decoration: none;
  }

  .table-container table tbody td:nth-child(2) a:hover {
    color: #E87722;
  }

  .table-container table tbody td:nth-child(3),
  .table-container table tbody td:nth-child(4),
  .table-container table tbody td:nth-child(5) {
    font-size: 0.75rem;
    color: #666;
    display: inline-block;
    margin-right: 12px;
    text-align: center;
  }

  .table-container table tbody td:nth-child(3):before {
    content: "";
  }

  .table-container table tbody td:nth-child(4):before {
    content: "";
  }

  .table-container table tbody td:nth-child(5):before {
    content: "";
  }

  /* Improve touch targets on mobile */
  .main-nav a, .nav-right a, .section ul li a {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .section ul li a {
    min-height: auto;
    /* padding: 8px 0; */
    justify-content: flex-start;
    text-align: left;
    padding: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .top-nav {
    padding: 0.4rem 0.75rem !important;
    flex-direction: row !important;
    gap: 0.2rem !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .top-nav img {
    height: 28px;
  }

  .nav-center h1 {
    font-size: 0.9rem;
  }

  .nav-right a {
    font-size: 0.85rem;
    margin-left: 0.4rem;
  }

  #user-info {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .main-nav {
    padding: 0 !important;
    gap: 0 !important;
  }

  .main-nav a {
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
  }

  .container {
    padding: 0 !important;
    gap: 0 !important;
  }

  .left, .right {
    padding: 0 !important;
  }

  h2 {
    font-size: 0.95rem;
  }

  .section ul li {
    font-size: 0.8rem;
    padding: 5px 0;
    text-align: left !important;
  }

  .category-tag {
    font-size: 0.65rem;
    padding: 1px 3px;
  }
}

/* Ensure smooth transitions */
.top-nav, .main-nav, .container, .left, .right {
  transition: all 0.3s ease;
}
