/*
Theme Name: MDDIR Business Theme
Theme URI: https://example.com
Author: Custom Build
Description: MDDIR Business Theme. Reads existing directory listings from the WordPress database.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: mddir-business
*/

:root {
  --primary: #1d2c9a;
  --primary-dark: #15237a;
  --accent: #00c194;
  --text: #222;
  --muted: #666;
  --bg: #f8f9fa;
  --white: #fff;
  --border: #e5e5e5;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

nav a {
  margin-left: 20px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

nav a:hover, nav a.active {
  color: var(--primary);
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.listing-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}

.listing-card:hover {
  transform: translateY(-4px);
}

.listing-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.listing-card .content {
  padding: 16px;
}

.listing-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.listing-card .meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard {
  background: var(--white);
  border-radius: 10px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dashboard-nav {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
}

.dashboard-nav a {
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--text);
}

.dashboard-nav a.active, .dashboard-nav a:hover {
  background: var(--primary);
  color: white;
}

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

table.listings-table th, table.listings-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.status-paid { color: #00a86b; font-weight: 600; }
.status-pending { color: #f39c12; font-weight: 600; }
.status-unpaid { color: #e74c3c; font-weight: 600; }

.payment-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.payment-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-card:hover, .payment-card.selected {
  border-color: var(--primary);
  background: #f0fff8;
}

footer.site-footer {
  background: #1a1a1a;
  color: #ccc;
  padding: 40px 0 20px;
  margin-top: 60px;
}

footer a { color: #fff; }

@media (max-width: 768px) {
  .header-inner, .dashboard-nav {
    flex-direction: column;
    align-items: flex-start;
  }
  nav a { margin: 8px 0; display: inline-block; }
}

nav a.btn {
  color: #fff;
  background: var(--accent);
}

.mddir-hero {
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 36px 28px;
  margin: 24px 0;
}

.mddir-hero h1,
.mddir-hero p { margin: 0 0 10px; color: #fff; }

.mddir-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mddir-search input,
.mddir-search select {
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  min-width: 180px;
}

.listing-card .thumb {
  display: block;
  background: #e8ecfb;
  min-height: 160px;
}

.thumb-fallback {
  display: grid;
  place-items: center;
  height: 160px;
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
}

.listing-card .address,
.card-actions { color: var(--muted); font-size: 0.9rem; }

.contact-box {
  margin-top: 20px;
  padding: 16px;
  background: #f4f6fb;
  border-radius: 8px;
}

.single-thumb img { width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; }

.mddir-pages { margin: 10px 0 30px; }
.mddir-pages a, .mddir-pages span { margin-right: 8px; }

header.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
header.site-header nav a { margin-left: 0; }
