/**
 * styles.css
 * Premium Modern Design System for BizDirectory
 */

:root {
    /* Color Palette - IBRE Theme (Red & Dark Gray) */
    --primary: #C8102E;
    /* Deep IBRE Red */
    --primary-light: #E02341;
    --primary-dark: #A00B23;

    --secondary: #707476;
    /* Dark Slate Gray from image */
    --secondary-light: #8C9093;

    --danger: #DC2626;
    /* Standard red for errors */
    --warning: #F59E0B;
    /* Amber for pending */

    /* Neurals & Backgrounds */
    --bg-main: #F8FAFC;
    /* Very light slate for contrast against white cards */
    --bg-card: #FFFFFF;
    --text-primary: #0F172A;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94A3B8;
    /* Slate 400 */
    --border-color: #E2E8F0;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Shadows - Soft and modern */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

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

html {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-main);
    line-height: 1.5;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

/* Typography Utilities */
.text-primary {
    color: var(--primary);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.py-md {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.py-xl {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-light);
    transform: translateY(-2px);
    color: white;
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background-color: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FECACA;
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition);
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: none;
    /* Hide old logo */
}

/* New IBRE Logo Styles */
.ibre-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-decoration: none;
}

.ibre-blocks {
    display: flex;
    gap: 4px;
}

.ibre-blocks span {
    background-color: var(--primary);
    color: white;
    font-size: 2.2rem;
    font-weight: 800;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ibre-tagline {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    text-transform: uppercase;
    white-space: nowrap;
}

.ibre-tagline .text-primary {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
}

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

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.shape-1 {
    top: -100px;
    right: -50px;
    width: 400px;
    height: 400px;
    background-color: var(--primary-light);
}

.shape-2 {
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background-color: var(--secondary-light);
}

/* Glass Panel (Search Container) */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-group {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.search-input-group input {
    width: 100%;
    padding: 1rem;
    padding-left: 3rem;
    border: none;
    border-radius: var(--radius-lg);
    background: rgba(248, 250, 252, 0.8);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input-group input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.filter-group select {
    padding: 1rem;
    border: none;
    border-radius: var(--radius-lg);
    background: rgba(248, 250, 252, 0.8);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 180px;
}

.filter-group select:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Grid Layout */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Business Card (Premium Design) */
.business-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.business-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-logo {
    width: 60px;
    height: 60px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.card-title-group {
    flex: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-blue {
    background: #E0E7FF;
    color: var(--primary-dark);
}

.badge-outline {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.card-body {
    flex: 1;
    margin-bottom: 1.5rem;
}

.card-services {
    background: var(--bg-main);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border-left: 3px solid var(--primary);
}

.card-services strong {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.card-services p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meta-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bg-main);
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    color: white;
}

.btn-full {
    width: 100%;
}

/* Loader Styles */
.loader-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 0 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-text {
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 0.95rem;
}

.footer-links h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
}

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

.footer-bottom {
    background-color: var(--bg-main);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Page Headers (for Admin and Submit pages) */
.page-header {
    background: var(--bg-card);
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
}

/* Form Container (Submit Page) */
.form-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-approved {
    background: #D1FAE5;
    color: #065F46;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .glass-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-group,
    .filter-group,
    #searchBtn {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* --- Modern Modal System --- */
.modal-overlay-email {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay-email.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.email-modal {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
    position: relative;
}

.modal-overlay-email.active .email-modal {
    transform: translateY(0);
}

.email-header {
    background: #1e293b;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-body {
    padding: 2.5rem;
}

.email-preview-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.6;
    color: #334155;
    max-height: 300px;
    overflow-y: auto;
}

/* Sending Animation */
.sending-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 10;
}

.mail-bounce {
    font-size: 3rem;
    animation: bounceMail 1.5s infinite ease-in-out;
}

@keyframes bounceMail {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: var(--bg-main);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
}

.progress-fill.animating {
    width: 100%;
    transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(0,0,0,0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* ============================================================
   Google AdSense Ad Units
   ============================================================ */

/* Top banner ad — sits between navbar and page content */
.ad-banner-top {
    width: 100%;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    text-align: center;
    overflow: hidden;
}

.ad-banner-top ins.adsbygoogle {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer link ad — sits just above the footer block */
.ad-footer-link {
    width: 100%;
    background: #f1f5f9;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0;
    text-align: center;
    overflow: hidden;
}

.ad-footer-link ins.adsbygoogle {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .ad-banner-top,
    .ad-footer-link {
        padding: 0.4rem 0;
    }
}