/* WebHive Directory - Main Stylesheet */
:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dark: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --info: #3b82f6;
    --border: #334155;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.navbar-brand:hover { color: var(--primary-light); }
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}
.navbar-nav a {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}
.navbar-nav a:hover { color: var(--text); }
.navbar-nav .active a { color: var(--primary); }
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg) 100%);
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.hero h1 span { color: var(--primary); }
.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 24px;
}

/* Search */
.search-box {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.search-box input {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    outline: none;
}
.search-box button {
    padding: 14px 24px;
    background: var(--primary);
    border: none;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.search-box button:hover { background: var(--primary-dark); }

/* Stats bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    margin-top: 24px;
}
.stat-item { text-align: center; }
.stat-item .stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-item .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section */
.section {
    padding: 40px 0;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-title .view-all {
    font-size: 14px;
    font-weight: 500;
}

/* Site Grid */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Site Card */
.site-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.site-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.site-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.site-card-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-tertiary);
}
.site-card-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 700;
}
.site-card-info h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}
.site-card-info h3 a { color: var(--text); }
.site-card-info h3 a:hover { color: var(--primary); }
.site-card-category {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}
.site-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.site-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.site-card-stats span { display: flex; align-items: center; gap: 4px; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-featured {
    background: rgba(245,158,11,0.15);
    color: var(--primary);
}
.badge-sponsor {
    background: rgba(59,130,246,0.15);
    color: var(--info);
}
.badge-pending {
    background: rgba(234,179,8,0.15);
    color: var(--warning);
}
.badge-approved {
    background: rgba(34,197,94,0.15);
    color: var(--success);
}
.badge-rejected {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
}

/* Like Button */
.like-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.like-btn:hover {
    background: rgba(239,68,68,0.15);
    border-color: #ef4444;
    color: #ef4444;
}
.like-btn.liked {
    background: rgba(239,68,68,0.15);
    border-color: #ef4444;
    color: #ef4444;
}

/* Visit Button */
.visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--primary);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}
.visit-btn:hover { background: var(--primary-dark); color: #000; }

/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}
.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.category-card-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--primary);
}
.category-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); color: #000; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { display: block; width: 100%; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: auto; }

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.alert-error { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: rgba(234,179,8,0.15); color: var(--warning); border: 1px solid rgba(234,179,8,0.3); }
.alert-info { background: rgba(59,130,246,0.15); color: var(--info); border: 1px solid rgba(59,130,246,0.3); }

/* Table */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tr:hover { background: rgba(255,255,255,0.02); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    list-style: none;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active span {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-weight: 600;
}

/* Sponsor Card */
.sponsor-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(59,130,246,0.1) 100%);
    border: 1px solid rgba(59,130,246,0.3);
}

/* Featured Card */
.featured-card {
    border-color: rgba(245,158,11,0.3);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 20px;
    margin-top: 60px;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}
.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    padding: 4px 0;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-dark);
    font-size: 13px;
}

/* Admin Sidebar */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.admin-sidebar-brand a {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}
.admin-nav { list-style: none; }
.admin-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.admin-nav li a:hover { background: var(--bg-tertiary); color: var(--text); }
.admin-nav li.active a { color: var(--primary); background: rgba(245,158,11,0.1); border-right: 3px solid var(--primary); }
.admin-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}
.admin-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }

/* Admin stat cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.d-none { display: none; }

/* Site Detail Page */
.site-detail {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    padding: 30px 0;
}
.site-detail-main { min-width: 0; }
.site-detail-sidebar { }
.site-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}
.site-detail-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
}
.site-detail-logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-muted);
}
.site-detail-info h1 { font-size: 1.8rem; line-height: 1.3; margin-bottom: 8px; }
.site-detail-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.site-detail-meta span { font-size: 14px; color: var(--text-muted); }

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}
.blog-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}
.blog-card:hover { transform: translateY(-2px); }
.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-tertiary);
}
.blog-card-body { padding: 20px; }
.blog-card-body h3 { font-size: 18px; margin-bottom: 8px; }
.blog-card-body h3 a { color: var(--text); }
.blog-card-body h3 a:hover { color: var(--primary); }
.blog-card-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.blog-card-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-content {
    line-height: 1.8;
    font-size: 16px;
}
.blog-content h2, .blog-content h3, .blog-content h4 {
    margin: 24px 0 12px;
}
.blog-content p { margin-bottom: 16px; }
.blog-content img {
    border-radius: var(--radius-sm);
    margin: 16px 0;
}
.blog-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 16px 0;
    color: var(--text-muted);
}
.blog-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s;
}
.tag:hover { background: var(--primary); color: #000; }

/* Responsive */
@media (max-width: 768px) {
    .navbar-toggle { display: block; }
    .navbar-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
        gap: 12px;
    }
    .navbar-nav.open { display: flex; }
    .hero h1 { font-size: 1.8rem; }
    .stats-bar { gap: 20px; flex-wrap: wrap; }
    .site-detail { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; gap: 20px; }
    .admin-sidebar { display: none; }
    .admin-content { margin-left: 0; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}
