@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  * {
    box-sizing: border-box;
  }

  body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.82rem;
    background: #e8ecf1;
    color: #333;
    margin: 0;
  }

  a {
    color: #105289;
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
  }
}

@layer components {
  .forum-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 8px;
  }

  .forum-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #dee2e6;
    font-size: 0.82rem;
  }

  .forum-table th {
    background: #e8edf3;
    color: #1a252f;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 0.78rem;
    text-align: left;
    border-bottom: 1px solid #cadceb;
  }

  .forum-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
  }

  .forum-table tr:last-child td {
    border-bottom: none;
  }

  .forum-table tr.row-alt td {
    background: #f8f9fa;
  }

  .forum-post {
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 8px;
  }

  .forum-post-header {
    background: #e8edf3;
    padding: 5px 8px;
    font-size: 0.78rem;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 1px solid #dee2e6;
  }

  .forum-post-body {
    display: flex;
    min-height: 120px;
  }

  .forum-post-sidebar {
    width: 160px;
    min-width: 160px;
    background: #f0f4f7;
    padding: 8px;
    text-align: center;
    border-right: 1px solid #dee2e6;
    font-size: 0.78rem;
  }

  .forum-post-content {
    flex: 1;
    padding: 10px 12px;
    line-height: 1.5;
    overflow-wrap: break-word;
  }

  .forum-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 6px;
    border-radius: 3px;
    object-fit: cover;
  }

  .forum-header {
    background: #1a252f;
    padding: 0;
  }

  .forum-header-inner {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
  }

  .forum-header-logo {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
  }

  .forum-header-tagline {
    color: #8ba3b9;
    font-size: 0.72rem;
  }

  .forum-nav {
    background: #2c3e50;
    border-bottom: 2px solid #3498db;
  }

  .forum-nav-inner {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    gap: 0;
  }

  .forum-nav-link {
    color: #c8d6e5;
    padding: 7px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
  }

  .forum-nav-link:hover {
    background: #34495e;
    color: #fff;
    text-decoration: none;
  }

  .forum-nav-link.active {
    background: #3498db;
    color: #fff;
  }

  .forum-footer {
    background: #1a252f;
    color: #8ba3b9;
    padding: 16px 0;
    margin-top: 20px;
    font-size: 0.75rem;
    text-align: center;
  }

  .forum-footer a {
    color: #bdc3c7;
  }

  .forum-footer-inner {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .forum-btn {
    display: inline-block;
    padding: 5px 14px;
    background: #3498db;
    color: #fff;
    border: 1px solid #2980b9;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
  }

  .forum-btn:hover {
    background: #2980b9;
    text-decoration: none;
    color: #fff;
  }

  .forum-btn-ghost {
    background: transparent;
    color: #c8d6e5;
    border: 1px solid #4a6278;
  }

  .forum-btn-ghost:hover {
    background: #34495e;
  }

  .forum-breadcrumb {
    font-size: 0.75rem;
    color: #6c757d;
    padding: 6px 0;
  }

  .forum-breadcrumb a {
    color: #105289;
  }

  .forum-breadcrumb span {
    color: #2c3e50;
  }

  .forum-page-title {
    font-size: 1.05rem;
    color: #1a252f;
    font-weight: 700;
    margin: 0 0 4px 0;
  }

  .forum-stat {
    font-size: 0.72rem;
    color: #6c757d;
  }

  .forum-pagination {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    font-size: 0.78rem;
  }

  .forum-pagination a,
  .forum-pagination span {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #dee2e6;
    border-radius: 2px;
    background: #fff;
    color: #105289;
  }

  .forum-pagination span.current {
    background: #3498db;
    color: #fff;
    border-color: #2980b9;
    font-weight: 600;
  }

  .forum-pagination a:hover {
    background: #e8edf3;
    text-decoration: none;
  }

  .forum-sidebar-block {
    background: #fff;
    border: 1px solid #dee2e6;
    margin-bottom: 10px;
  }

  .forum-sidebar-title {
    background: #e8edf3;
    padding: 5px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #dee2e6;
  }

  .forum-sidebar-content {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .forum-sidebar-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .forum-sidebar-content li {
    padding: 3px 0;
    border-bottom: 1px dotted #e9ecef;
  }

  .forum-sidebar-content li:last-child {
    border-bottom: none;
  }

  .forum-online {
    color: #27ae60;
    font-weight: 600;
    font-size: 0.7rem;
  }

  .forum-offline {
    color: #95a5a6;
    font-size: 0.7rem;
  }

  .badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.68rem;
    font-weight: 600;
    background: #e8edf3;
    color: #2c3e50;
    margin-right: 3px;
  }

  .badge-new {
    background: #27ae60;
    color: #fff;
  }

  .badge-hot {
    background: #e74c3c;
    color: #fff;
  }

  /* Auth modal */
  .auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-modal {
    background: #fff;
    border-radius: 4px;
    width: 380px;
    max-width: 95vw;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  }

  .auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e8edf3;
    padding: 0;
    border-bottom: 1px solid #dee2e6;
    border-radius: 4px 4px 0 0;
  }

  .auth-tabs {
    display: flex;
  }

  .auth-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 2px solid transparent;
  }

  .auth-tab:hover {
    color: #2c3e50;
  }

  .auth-tab.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
  }

  .auth-close {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #6c757d;
    line-height: 1;
  }

  .auth-close:hover {
    color: #e74c3c;
  }

  .auth-modal-body {
    padding: 20px;
  }

  .auth-form label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 10px 0 4px;
  }

  .auth-form input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 0.82rem;
    box-sizing: border-box;
  }

  .auth-form input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
  }
}