/* ============================================
   FindFranchise.com - Main Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #1a3a5c;
    --primary-dark: #0f2640;
    --primary-light: #2d6aa0;
    --accent: #c8813a;
    --accent-light: #e6a756;
    --accent-dark: #b06e2e;
    --bg: #fafafa;
    --bg-alt: #f7f5f2;
    --white: #ffffff;
    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

/* --- Typography --- */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 800; line-height: 1.2; }
h1 { font-size: 2.8rem; letter-spacing: -0.5px; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.4rem; }

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

/* --- Navigation --- */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 40px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    position: sticky; top: 0; z-index: 100;
}

.navbar-brand {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
}

.navbar-brand .brand-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 14px;
}

.navbar-brand .brand-text {
    font-weight: 800; font-size: 20px; color: var(--primary); letter-spacing: -0.5px;
}
.navbar-brand .brand-text span { color: var(--accent); }

.navbar-links { display: flex; gap: 32px; align-items: center; }
.navbar-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.navbar-links a:hover { color: var(--text); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius-sm); font-size: 14px;
    font-weight: 600; font-family: var(--font-body); cursor: pointer;
    transition: var(--transition); border: none; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; }
.btn-accent:hover { opacity: 0.9; color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 16px 36px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-white { background: rgba(255,255,255,0.08); color: #fff; border: 1.5px solid rgba(255,255,255,0.15); }
.btn-white:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* --- Hero Section --- */
.hero {
    padding: 80px 40px 60px;
    background: linear-gradient(165deg, var(--primary-dark) 0%, var(--primary) 40%, #2d5a82 100%);
    position: relative; overflow: hidden; text-align: center;
}
.hero::before {
    content: ''; position: absolute; top: -100px; right: -100px;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(200,129,58,0.12), transparent 70%);
}
.hero::after {
    content: ''; position: absolute; bottom: -80px; left: -80px;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.04), transparent 70%);
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(200,129,58,0.15); border-radius: 30px;
    padding: 8px 20px; margin-bottom: 28px;
    border: 1px solid rgba(200,129,58,0.2);
    color: var(--accent-light); font-size: 13px; font-weight: 600;
    letter-spacing: 0.5px;
}

.hero h1 { color: #fff; font-size: 3.2rem; margin-bottom: 20px; }
.hero h1 .highlight {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 18px; color: rgba(255,255,255,0.65); max-width: 540px; margin: 0 auto 40px; line-height: 1.6; }

/* --- Search Bar --- */
.search-bar {
    display: flex; max-width: 640px; margin: 0 auto;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.1);
}
.search-bar input {
    flex: 1; padding: 20px 20px 20px 52px; border: none;
    font-size: 16px; font-family: var(--font-body);
    outline: none; background: transparent; color: var(--text);
}
.search-bar .search-icon {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    font-size: 18px; opacity: 0.3;
}
.search-bar .search-input-wrap { flex: 1; position: relative; }
.search-bar button {
    padding: 20px 32px; background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff; border: none; font-size: 16px; font-weight: 700;
    font-family: var(--font-body); cursor: pointer; letter-spacing: 0.3px;
}
.search-bar button:hover { opacity: 0.9; }

/* --- Stats Row --- */
.stats-row {
    display: flex; justify-content: center; gap: 60px;
    margin-top: 50px;
}
.stats-row .stat { text-align: center; }
.stats-row .stat-value { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.stats-row .stat-label { font-size: 13px; color: rgba(255,255,255,0.45); margin-top: 4px; }

/* --- Section --- */
.section { padding: 60px 0; }
.section-header { margin-bottom: 32px; }
.section-header h2 { margin-bottom: 8px; }
.section-header p { color: var(--text-secondary); font-size: 15px; }

/* --- Category Grid --- */
.category-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.category-card {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 18px 16px; background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    font-size: 14px; font-weight: 600;
    transition: var(--transition); text-decoration: none; color: var(--text);
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--text); }
.category-card.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.category-card .cat-count {
    font-size: 11px; opacity: 0.6;
    background: var(--border-light); padding: 2px 8px; border-radius: 10px;
}
.category-card.active .cat-count { background: rgba(255,255,255,0.15); }

/* --- Filters --- */
.filter-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.filter-bar .results-count { font-size: 14px; color: var(--text-secondary); }
.filter-bar .results-count strong { color: var(--text); }
.filter-group { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn {
    padding: 8px 18px; background: #fff;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; font-family: var(--font-body);
    cursor: pointer; transition: var(--transition); color: var(--text-secondary);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.sort-select {
    padding: 8px 16px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    font-family: var(--font-body); color: var(--text-secondary);
    outline: none; cursor: pointer; background: #fff;
}

/* --- Franchise Card --- */
.franchise-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.franchise-card {
    background: #fff; border-radius: 16px; overflow: hidden;
    transition: var(--transition); box-shadow: var(--shadow-sm);
    text-decoration: none; color: var(--text); display: block;
}
.franchise-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.04);
    color: var(--text);
}

.franchise-card .card-accent { height: 6px; }
.franchise-card .card-body { padding: 24px; }

.franchise-card .card-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }

.franchise-card .card-logo {
    width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px;
}
.franchise-card .card-logo.small-text { font-size: 13px; }

.franchise-card .card-title { margin: 0; font-family: var(--font-body); font-size: 18px; font-weight: 700; }
.franchise-card .card-tagline { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

.franchise-card .card-badge {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 20px; padding: 4px 12px; margin-bottom: 16px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.franchise-card .card-badge .dot { font-size: 10px; }

.franchise-card .card-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding-top: 16px; border-top: 1px solid var(--border-light);
}
.franchise-card .card-stat-label {
    font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;
}
.franchise-card .card-stat-value { font-size: 15px; font-weight: 700; }

.franchise-card .card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 12px; border-top: 1px solid var(--border-light); margin-top: 12px;
}
.franchise-card .card-link { font-size: 12px; font-weight: 600; opacity: 0.7; transition: opacity 0.2s; }
.franchise-card:hover .card-link { opacity: 1; }

/* Star Rating */
.star-rating { font-size: 13px; letter-spacing: 1px; }
.star.full { color: #f59e0b; }
.star.half { color: #f59e0b; opacity: 0.6; }
.star.empty { color: #d1d5db; }
.rating-number { color: var(--text-secondary); margin-left: 4px; font-size: 12px; }

/* Plan Badges */
.plan-badge {
    display: inline-flex; padding: 2px 10px; border-radius: 6px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.plan-badge.elite { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.plan-badge.premium { background: linear-gradient(135deg, #818cf8, #6366f1); color: #fff; }

/* --- Franchise Detail Page --- */
.franchise-detail-header {
    padding: 60px 0;
    background: linear-gradient(165deg, var(--primary-dark) 0%, var(--primary) 100%);
    position: relative; overflow: hidden;
}
.franchise-detail-header::before {
    content: ''; position: absolute; top: -80px; right: -80px;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(200,129,58,0.1), transparent 70%);
}

.detail-header-content {
    display: flex; align-items: center; gap: 24px;
    position: relative; z-index: 1;
}

.detail-logo {
    width: 80px; height: 80px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 28px; flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.2);
}
.detail-logo.small-text { font-size: 16px; }

.detail-header-info h1 { color: #fff; font-size: 2.2rem; margin-bottom: 6px; font-family: var(--font-display); }
.detail-header-info .tagline { color: rgba(255,255,255,0.6); font-size: 16px; }
.detail-header-info .meta {
    display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap;
}
.detail-header-info .meta-item {
    display: flex; align-items: center; gap: 4px;
    color: rgba(255,255,255,0.5); font-size: 13px;
}

.detail-content { padding: 40px 0 60px; }
.detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }

.detail-main {}
.detail-section { margin-bottom: 36px; }
.detail-section h2 {
    font-size: 1.3rem; margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}
.detail-section p { color: var(--text-secondary); line-height: 1.8; white-space: pre-line; }

.detail-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 36px;
}
.detail-stat-card {
    background: #fff; border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-sm); text-align: center;
}
.detail-stat-card .stat-label {
    font-size: 11px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 6px;
}
.detail-stat-card .stat-value { font-size: 22px; font-weight: 800; color: var(--text); }

/* --- Lead Form Sidebar --- */
.lead-form-card {
    background: #fff; border-radius: var(--radius-lg); padding: 32px;
    box-shadow: var(--shadow-md); position: sticky; top: 90px;
}
.lead-form-card h3 {
    font-family: var(--font-body); font-size: 20px; font-weight: 700;
    margin-bottom: 4px;
}
.lead-form-card .form-subtitle {
    color: var(--text-secondary); font-size: 14px; margin-bottom: 20px;
}

.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text); margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-control {
    width: 100%; padding: 12px 16px; border: 1.5px solid var(--border);
    border-radius: 12px; font-size: 14px; font-family: var(--font-body);
    outline: none; transition: border-color 0.2s; background: #fff; color: var(--text);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,0.08); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-disclaimer {
    font-size: 11px; color: var(--text-muted); margin-top: 12px; text-align: center; line-height: 1.5;
}

/* --- How It Works --- */
.how-it-works { background: linear-gradient(180deg, #fff, var(--bg-alt)); padding: 80px 0; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }

.step-card { text-align: center; position: relative; }
.step-card .step-number {
    font-size: 72px; font-family: var(--font-display); font-weight: 900;
    color: rgba(26,58,92,0.04); line-height: 1; position: absolute; top: -20px;
    left: 50%; transform: translateX(-50%);
}
.step-card .step-icon {
    width: 72px; height: 72px; border-radius: 20px;
    background: linear-gradient(135deg, rgba(26,58,92,0.06), rgba(26,58,92,0.02));
    border: 1.5px solid rgba(26,58,92,0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; margin: 0 auto 20px; position: relative;
}
.step-card h3 { font-family: var(--font-body); font-size: 20px; margin-bottom: 10px; }
.step-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }

/* --- CTA Section --- */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(165deg, var(--primary-dark), var(--primary));
    position: relative; overflow: hidden; text-align: center;
}
.cta-section::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 40%; height: 100%;
    background: radial-gradient(ellipse at right, rgba(200,129,58,0.1), transparent 60%);
}
.cta-section h2 { color: #fff; font-size: 2.4rem; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.6); font-size: 17px; line-height: 1.7; max-width: 520px; margin: 0 auto 36px; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; }

.cta-stats {
    display: flex; justify-content: center; gap: 40px; margin-top: 48px;
}
.cta-stats .stat-value { font-size: 28px; font-weight: 800; color: var(--accent-light); }
.cta-stats .stat-label { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 4px; }

/* --- Footer --- */
.footer {
    padding: 48px 40px 32px;
    background: #0a1929;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
    margin-bottom: 40px;
}
.footer .brand-desc { color: rgba(255,255,255,0.35); font-size: 13px; line-height: 1.7; max-width: 280px; }
.footer h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.footer .footer-links a {
    display: block; color: rgba(255,255,255,0.35); font-size: 13px; margin-bottom: 10px;
}
.footer .footer-links a:hover { color: rgba(255,255,255,0.7); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 24px; display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom span { color: rgba(255,255,255,0.25); font-size: 12px; }
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-links a { color: rgba(255,255,255,0.25); font-size: 12px; }
.footer-bottom-links a:hover { color: rgba(255,255,255,0.5); }

/* --- List Your Franchise Page --- */
.listing-hero {
    padding: 60px 0;
    background: linear-gradient(165deg, var(--primary-dark) 0%, var(--primary) 100%);
    text-align: center;
}
.listing-hero h1 { color: #fff; margin-bottom: 12px; }
.listing-hero p { color: rgba(255,255,255,0.6); font-size: 17px; max-width: 560px; margin: 0 auto; }

.listing-form-section { padding: 60px 0; }
.listing-form-card {
    background: #fff; border-radius: var(--radius-lg); padding: 40px;
    box-shadow: var(--shadow-md); max-width: 640px; margin: 0 auto;
}

.benefits-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
    padding: 60px 0; max-width: 900px; margin: 0 auto;
}
.benefit-card { text-align: center; }
.benefit-card .benefit-icon { font-size: 36px; margin-bottom: 12px; }
.benefit-card h3 { font-family: var(--font-body); font-size: 16px; margin-bottom: 8px; }
.benefit-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* --- Flash Messages --- */
.flash-message {
    padding: 16px 24px; border-radius: var(--radius-sm); margin-bottom: 24px;
    font-size: 14px; font-weight: 500;
}
.flash-message.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-message.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-message.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* --- Pagination --- */
.pagination {
    display: flex; justify-content: center; gap: 8px; margin-top: 40px;
}
.page-link {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: #fff; border: 1.5px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    text-decoration: none; transition: var(--transition);
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* --- No Results --- */
.no-results {
    text-align: center; padding: 80px 20px;
    background: #fff; border-radius: var(--radius-lg); border: 1.5px dashed var(--border);
}
.no-results .icon { font-size: 48px; margin-bottom: 16px; }
.no-results h3 { font-family: var(--font-body); font-size: 20px; margin-bottom: 8px; }
.no-results p { color: var(--text-secondary); }

/* --- Related Franchises --- */
.related-section { margin-top: 60px; padding-top: 40px; border-top: 2px solid var(--border-light); }

/* --- Mobile Menu Toggle (hidden on desktop) --- */
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .detail-layout { grid-template-columns: 1fr; }
    .lead-form-card { position: static; }
    .franchise-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
    .navbar { padding: 12px 20px; }
    .navbar-links { display: none; }
    .mobile-menu-toggle { display: block; }

    .hero { padding: 50px 20px 40px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 15px; }

    .search-bar { flex-direction: column; }
    .search-bar button { padding: 16px; }

    .stats-row { flex-wrap: wrap; gap: 24px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .franchise-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; gap: 30px; }
    .detail-stats-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .benefits-grid { grid-template-columns: 1fr; }
    .cta-buttons { flex-direction: column; align-items: center; }
    .filter-bar { flex-direction: column; align-items: flex-start; }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .container { padding: 0 16px; }
}
