/* ============================
   IklanBaris - Main Stylesheet
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Open+Sans:wght@400;500;600&display=swap');

:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --accent: #FF6B35;
    --text: #2d2d2d;
    --text-light: #666;
    --bg: #f5f5f5;
    --white: #ffffff;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --header-bg: #ffffff;
    --pending: #f0ad4e;
    --danger: #e74c3c;
    --info: #3498db;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover { color: var(--primary-dark); }

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

/* ===== HEADER ===== */
.site-header {
    background: var(--white);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    font-family: 'Nunito', sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    text-decoration: none;
}
.logo span:first-child { color: #e74c3c; }
.logo span:nth-child(2) { color: #f39c12; }
.logo span:nth-child(3) { color: #2ecc71; }
.logo span:nth-child(4) { color: #3498db; }
.logo em { color: var(--text); font-style: normal; }

.header-search {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.header-search input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    font-family: 'Open Sans', sans-serif;
}

.header-search button {
    padding: 8px 14px;
    background: var(--primary);
    border: none;
    cursor: pointer;
    color: white;
    font-size: 15px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-nav select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.btn-pasang {
    background: var(--primary);
    color: white !important;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-pasang:hover { background: var(--primary-dark); color: white !important; }

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== BANNERS ===== */
.banner-area {
    text-align: center;
    margin: 12px 0;
    overflow: hidden;
    width: 100%;
    display: block;
}

.banner-area a{
    display: block;
    width: 100%;
}

.banner-area img {
    display: inline-block;
    max-width: 100%;
    border-radius: 4px;
}

.banner-placeholder {
    display: inline-flex;
    max-width: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
}

/* ===== MAIN LAYOUT ===== */
.main-wrapper {
    display: flex;
    gap: 20px;
    padding: 16px 0;
}

.main-content { flex: 1; min-width: 0; }

.sidebar {
    width: 160px;
    flex-shrink: 0;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-family: 'Nunito', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    padding: 8px 0 12px;
    border-bottom: 3px solid var(--primary);
    margin-bottom: 16px;
    display: inline-block;
}

/* ===== ADS GRID ===== */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

/* ===== AD CARD ===== */
.ad-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ad-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.ad-card a { text-decoration: none; color: inherit; }

.ad-card-body {
    padding: 10px;
}

.ad-card-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-card-desc {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

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

.ad-card-no-img {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #e8f4fd, #d5e8d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #aaa;
}

.ad-card-meta {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-top: 4px;
}

.ad-card-date { font-size: 10px; }

.wa-icon {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.wa-icon svg { width: 16px; height: 16px; }

.ad-category-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 600;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 16px 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background: var(--white);
    transition: all 0.2s;
}

.pagination a:hover { background: var(--primary); color: white; border-color: var(--primary); }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination .disabled { color: #ccc; cursor: not-allowed; }

/* ===== AD DETAIL ===== */
.ad-detail-wrap {
    display: flex;
    gap: 20px;
    padding: 16px 0;
}

.ad-detail-main {
    flex: 1;
    min-width: 0;
}

.ad-detail-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.ad-detail-title {
    font-family: 'Nunito', sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
}

.ad-detail-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.ad-detail-desc {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 16px;
}

.ad-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ad-images img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
}

.wa-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 15px;
    transition: background 0.2s;
}

.wa-contact-btn:hover { background: var(--primary-dark); color: white; }
.wa-contact-btn svg { width: 22px; height: 22px; }

/* ===== FORMS ===== */
.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 640px;
    margin: 0 auto;
}

.form-title {
    font-family: 'Nunito', sans-serif;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
}

.form-group textarea { height: 120px; resize: vertical; }

.wa-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.wa-input-wrap .wa-prefix {
    padding: 9px 12px;
    background: #f5f5f5;
    border-right: 1px solid var(--border);
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.wa-input-wrap input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.wa-input-wrap input:focus { box-shadow: none; }

.form-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrap input { width: auto; }

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: 'Open Sans', sans-serif;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #6c757d; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-warning { background: var(--pending); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ===== SEARCH PAGE ===== */
.search-header {
    padding: 16px 0 8px;
    font-size: 15px;
    color: var(--text-light);
}

.search-header strong { color: var(--text); }

/* ===== CATEGORY NAV ===== */
.category-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.category-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    gap: 0;
}

.category-nav a {
    display: inline-block;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-nav a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.category-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 24px 16px;
    margin-top: 32px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-light);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--primary); }

.footer-copy {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== ADMIN ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: #2c3e50;
    color: white;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
}

.admin-logo {
    padding: 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 800;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-nav { padding: 12px 0; }

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.12);
    color: white;
}

.admin-nav a .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.admin-main {
    margin-left: 220px;
    flex: 1;
    background: #f0f2f5;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--white);
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar h1 {
    font-family: 'Nunito', sans-serif;
    font-size: 20px;
    font-weight: 800;
}

.admin-content { padding: 24px; }

.admin-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.admin-card h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-number {
    font-family: 'Nunito', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Table */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

table tr:hover td { background: #fafafa; }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-approved { background: #d4edda; color: #155724; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e9, #e3f2fd);
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo span {
    font-family: 'Nunito', sans-serif;
    font-size: 28px;
    font-weight: 800;
}

/* ===== RELATED ADS ===== */
.related-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

/* ===== VIEWS BADGE ===== */
.views-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--text-light);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-inner { padding: 8px 12px; gap: 10px; }
    .logo { font-size: 22px; }
    .banner-placeholder {
        width: 100% !important;
        height: 50px !important;
        font-size: 12px;
    }
    .banner-area img {
        width: 100% !important;
        height: auto !important;
        max-height: 80px;
        object-fit: cover;
    }
    
    .header-search { order: 3; min-width: 100%; }
    
    .main-wrapper { flex-direction: column; }
    .sidebar { width: 100%; }
    
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .ad-detail-wrap { flex-direction: column; }
    
    .admin-sidebar { 
        width: 100%;
        height: auto;
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .admin-main { margin-left: 0; }
    .admin-nav { display: flex; flex-wrap: wrap; padding: 0; }
    .admin-nav a { padding: 8px 12px; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .footer-links { gap: 12px; }

    .ad-images img { width: 100%; height: 200px; }
    
    .form-card { padding: 16px; }
}

@media (max-width: 480px) {
    .ads-grid { grid-template-columns: repeat(2, 1fr); }
    .category-nav a { padding: 8px 10px; font-size: 12px; }
}

/* ===== LAZY LOAD ===== */
img[data-src] { opacity: 0; transition: opacity 0.3s; }
img.loaded { opacity: 1; }

/* ===== SUCCESS PAGE ===== */
.success-page {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.success-page h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 12px;
}


