/* ============================================
   BiyeJachai - Main CSS (Critical Fixes)
   ============================================ */

/* ---------- HERO SECTION FIX ---------- */
.hero {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    color: #fff !important;
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-text h1 .highlight {
    color: #fef08a !important;
    display: block;
}

.hero-text p {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 1.05rem;
    margin-bottom: 28px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    text-decoration: none;
}

.hero-buttons .btn-primary {
    background: #fff !important;
    color: #7c3aed !important;
    border: none;
}

.hero-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hero-buttons .btn-outline {
    background: transparent !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

.hero-buttons .btn-outline:hover {
    background: #fff !important;
    color: #7c3aed !important;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    display: block;
}

/* ---------- STATS SECTION FIX ---------- */
.stats {
    background: #fff;
    padding: 40px 0;
    margin-top: -40px;
    position: relative;
    z-index: 5;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.stat-item {
    padding: 20px 15px;
    background: #f9fafb;
    border-radius: 16px;
    transition: all 0.3s;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.15);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ec4899;
    margin-bottom: 6px;
    line-height: 1;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* ---------- SEARCH SECTION FIX ---------- */
.search-section {
    padding: 40px 0 60px;
    background: linear-gradient(to bottom, #f9fafb, #fff);
}

.search-box {
    background: #fff;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.search-box h2 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 24px;
    color: #1f2937;
}

/* Search Keyword Wrapper */
.search-keyword-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.keyword-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.keyword-input-wrapper .search-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}

.keyword-input {
    width: 100%;
    padding: 16px 50px 16px 50px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    background: #f9fafb;
    transition: all 0.3s;
}

.keyword-input:focus {
    outline: none;
    border-color: #ec4899;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: #e5e7eb;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #ec4899;
    color: #fff;
}

.clear-btn.hidden {
    display: none;
}

/* Live Results */
.live-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    border: 1px solid #e5e7eb;
}

.live-results.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.live-loading {
    padding: 30px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.live-no-results {
    padding: 30px;
    text-align: center;
    color: #6b7280;
}

.live-results-header {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.live-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s;
    color: inherit !important;
    text-decoration: none;
}

.live-result-item:hover {
    background: #fef3f8;
}

.live-result-thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

.live-result-content {
    flex: 1;
    min-width: 0;
}

.live-result-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 3px;
}

.live-result-meta {
    font-size: 12px;
    color: #6b7280;
}

.live-results-footer {
    display: block;
    padding: 14px 16px;
    text-align: center;
    background: #f9fafb;
    color: #ec4899 !important;
    font-weight: 600;
    font-size: 14px;
    border-top: 1px solid #e5e7eb;
    text-decoration: none;
}

.live-results-footer:hover {
    background: #fef3f8;
}

/* Search Grid */
.search-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.search-grid > div {
    display: flex;
    flex-direction: column;
}

.search-grid label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: #f9fafb;
    transition: all 0.2s;
    color: #1f2937;
}

.form-control:focus {
    outline: none;
    border-color: #ec4899;
    background: #fff;
}

.btn-search-submit {
    padding: 14px 24px;
    font-size: 15px;
    border-radius: 12px;
    white-space: nowrap;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
}

/* Quick Tags */
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.quick-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.quick-tag {
    padding: 6px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.quick-tag:hover {
    background: #fef3f8;
    border-color: #ec4899;
    color: #ec4899;
}

.quick-tag.active {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    border-color: transparent;
}

/* ---------- SECTIONS ---------- */
.section {
    padding: 60px 0;
}

.section-gray {
    background: #f3f4f6;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #1f2937;
}

.section-title p {
    color: #6b7280;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- PROFILE GRID ---------- */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.profile-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.profile-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.profile-card-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 280px;
    background: linear-gradient(135deg, #fce7f3, #ede9fe);
}

.profile-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    opacity: 0.6;
}

.profile-card-body {
    padding: 20px;
}

.profile-card-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.profile-card-name a {
    color: #1f2937;
    text-decoration: none;
}

.profile-card-name a:hover {
    color: #ec4899;
}

.profile-card-info {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.profile-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.profile-card-id {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: #1f2937;
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.empty-state p {
    margin-bottom: 20px;
    color: #6b7280;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-size: 15px;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ec4899;
    color: #ec4899;
}

.btn-outline:hover {
    background: #ec4899;
    color: #fff;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ---------- CONTAINER ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.text-center { text-align: center; }

/* ============================================
   TABLET - 1024px
   ============================================ */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .hero-text h1 { font-size: 2rem; }
    .hero-image img { max-width: 100%; }
    
    .search-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .btn-search-submit {
        grid-column: span 3;
    }
    
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   MOBILE - 768px
   ============================================ */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0 60px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-text p {
        font-size: 0.95rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .hero-image {
        margin-top: 30px;
    }
    
    .hero-image img {
        max-width: 100%;
    }
    
    /* Stats */
    .stats {
        padding: 30px 0;
        margin-top: 0;
        border-radius: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: 12px; }
    
    /* Search */
    .search-section {
        padding: 20px 0 40px;
    }
    
    .search-box {
        padding: 20px;
        border-radius: 16px;
        margin-top: 0;
    }
    
    .search-box h2 {
        font-size: 1.25rem;
    }
    
    .keyword-input {
        padding: 14px 44px;
        font-size: 15px;
    }
    
    .search-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .btn-search-submit {
        grid-column: span 1;
        width: 100%;
    }
    
    /* Sections */
    .section { padding: 40px 0; }
    .section-title { margin-bottom: 30px; }
    .section-title h2 { font-size: 1.5rem; }
    
    /* Profile Grid */
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profile-card-image-wrapper {
        height: 260px;
    }
    
    /* Live Results */
    .live-results {
        max-height: 320px;
    }
}

/* ============================================
   SMALL MOBILE - 480px
   ============================================ */
@media (max-width: 480px) {
    .hero-text h1 { font-size: 1.5rem; }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-tags {
        justify-content: center;
    }
}

/* ============================================
   NAVBAR FIX
   ============================================ */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    gap: 20px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo .logo-icon {
    font-size: 28px;
}

.site-logo .logo-text {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav a {
    color: #1f2937;
    font-weight: 500;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 0;
}

.main-nav a:hover {
    color: #ec4899;
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.nav-actions .btn {
    padding: 10px 18px;
    font-size: 14px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #1f2937;
}

/* Mobile Nav */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        flex-direction: column;
    }
    
    .main-nav.active { display: flex; }
    
    .main-nav ul {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .main-nav a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .nav-actions .btn-outline { display: none; }
}