/*
 * Business Website Theme
 * CSS Custom Properties for easy reskinning
 */

:root {
    /* Primary brand colors */
    --bs-primary: #0d6efd;
    --bs-primary-rgb: 13, 110, 253;
    --brand-primary: var(--bs-primary);
    --brand-primary-hover: #0b5ed7;

    /* Secondary colors */
    --bs-secondary: #6c757d;
    --bs-secondary-rgb: 108, 117, 125;
    --brand-secondary: var(--bs-secondary);

    /* Accent colors */
    --brand-accent: #ffc107;
    --brand-accent-hover: #ffca2c;

    /* Text colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-light: #f8f9fa;

    /* Background colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #212529;

    /* Border colors */
    --border-color: #dee2e6;
    --border-radius: 0.375rem;

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

    /* Typography */
    --font-family-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --font-size-base: 1rem;
    --line-height-base: 1.5;

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

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Base styles */
body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-primary, #ffffff);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    background-color: var(--bg-primary, #ffffff);
}

/* Main container background */
main.container {
    background-color: transparent;
}

/* Link styles */
a {
    color: var(--link-color, var(--brand-primary));
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--link-hover-color, var(--brand-primary-hover));
}

/* Heading styles */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading, var(--text-primary));
}

/* Button customization */
.btn-primary {
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary-hover);
    --bs-btn-hover-border-color: var(--brand-primary-hover);
}

/* Accent button - secondary CTA */
.btn-accent {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #fff;
}

.btn-accent:hover {
    background-color: var(--brand-accent-hover, var(--brand-accent));
    border-color: var(--brand-accent-hover, var(--brand-accent));
    filter: brightness(0.9);
    color: #fff;
}

.btn-outline-accent {
    color: var(--brand-accent);
    border-color: var(--brand-accent);
    background-color: transparent;
}

.btn-outline-accent:hover {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #fff;
}

/* Accent text and background utilities */
.text-accent {
    color: var(--brand-accent) !important;
}

.bg-accent {
    background-color: var(--brand-accent) !important;
}

/* Featured/highlight badge */
.badge-accent {
    background-color: var(--brand-accent);
    color: #fff;
}

.badge-featured {
    background-color: var(--brand-accent);
    color: #fff;
    font-weight: 600;
}

/* Star ratings use accent color */
.rating-star {
    color: var(--brand-accent);
}

.rating-star-empty {
    color: var(--border-color, #dee2e6);
}

/* Focus rings use accent */
.btn:focus-visible,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-accent-rgb, 245, 158, 11), 0.25);
}

/* Card customization */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Navbar customization */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 600;
    color: var(--brand-primary) !important;
}

/* Footer customization */
footer {
    border-top: 1px solid var(--border-color);
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Form styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Utility classes */
.text-brand {
    color: var(--brand-primary);
}

.bg-brand {
    background-color: var(--brand-primary);
}

.border-brand {
    border-color: var(--brand-primary);
}

/* =====================
   Bootstrap Overrides
   Use tenant CSS variables
   ===================== */

/* Override Bootstrap's bg-light to use tenant background */
.bg-light {
    background-color: var(--bg-light, #f8f9fa) !important;
}

/* Override Bootstrap's bg-dark to use tenant dark */
.bg-dark {
    background-color: var(--bg-dark, #212529) !important;
}

/* Override Bootstrap's bg-primary to use tenant primary */
.bg-primary {
    background-color: var(--brand-primary, var(--bs-primary)) !important;
}

/* Override Bootstrap's bg-secondary to use tenant secondary */
.bg-secondary {
    background-color: var(--brand-secondary, var(--bs-secondary)) !important;
}

/* Override Bootstrap's text colors */
.text-muted {
    color: var(--text-muted, #6c757d) !important;
}

.text-secondary {
    color: var(--text-muted, #6c757d) !important;
}

.text-dark {
    color: var(--text-primary, #212529) !important;
}

.text-primary {
    color: var(--brand-primary, var(--bs-primary)) !important;
}

/* Override Bootstrap's border colors */
.border-top, .border-bottom, .border-start, .border-end, .border {
    border-color: var(--border-color, #dee2e6) !important;
}

/* Card styling with tenant colors */
.card {
    background-color: var(--bg-card, var(--bg-primary, #ffffff));
    border-color: var(--border-color, #dee2e6);
    border-radius: var(--border-radius, 0.375rem);
}

.card-header.bg-primary {
    background: var(--brand-primary) !important;
    border-radius: calc(var(--border-radius, 0.375rem) - 1px) calc(var(--border-radius, 0.375rem) - 1px) 0 0;
}

/* Navbar tenant theming */
.navbar {
    background-color: var(--bg-navbar, #ffffff) !important;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

.navbar.bg-light {
    background-color: var(--bg-navbar, var(--bg-light, #f8f9fa)) !important;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--text-primary, #212529);
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: var(--brand-primary);
}

/* Dropdown menus */
.dropdown-menu {
    background-color: var(--bg-primary, #ffffff);
    border-color: var(--border-color, #dee2e6);
}

.dropdown-item {
    color: var(--text-primary, #212529);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--bg-light, #f8f9fa);
    color: var(--brand-primary);
}

.dropdown-divider {
    border-top-color: var(--border-color, #dee2e6);
}

/* =====================
   Landing Page Styles
   ===================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hero section */
.hero-section {
    background: var(--bg-hero, linear-gradient(135deg, var(--bg-light, #f8f9fa) 0%, var(--bg-light-alt, #e9ecef) 100%));
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-section h1 {
    color: var(--text-heading, var(--text-primary));
}

.hero-section .lead {
    color: var(--text-muted);
}

/* CTA Button */
.btn-cta {
    font-weight: 600;
    border-radius: 50px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Feature cards */
.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1), rgba(var(--bs-primary-rgb), 0.05));
    border-radius: 50%;
}

/* Product cards */
.product-card {
    transition: all var(--transition-normal);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Testimonials */
.testimonial-avatar .avatar-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
}

/* FAQ Accordion */
.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1), rgba(var(--bs-primary-rgb), 0.05));
    color: var(--brand-primary);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--border-color);
}

/* CTA Section */
.cta-section {
    background: var(--bg-cta, linear-gradient(135deg, var(--brand-primary) 0%, var(--bs-secondary, var(--brand-primary)) 100%));
}

/* Fade-in animation */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for grid items */
.row > .fade-in-section:nth-child(1) { transition-delay: 0s; }
.row > .fade-in-section:nth-child(2) { transition-delay: 0.1s; }
.row > .fade-in-section:nth-child(3) { transition-delay: 0.2s; }
.row > .fade-in-section:nth-child(4) { transition-delay: 0.3s; }

/* =====================
   Product Pages Styles
   ===================== */

/* Page header */
.page-header {
    background: linear-gradient(135deg, var(--bg-light, #f8f9fa) 0%, var(--bg-light-alt, #e9ecef) 100%);
}

/* Product images */
.product-image {
    height: 200px;
    object-fit: cover;
}

.product-image-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--bg-light, #f8f9fa) 0%, var(--bg-light-alt, #e9ecef) 100%);
}

/* Product detail page */
.product-detail-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.product-detail-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--bg-light, #f8f9fa) 0%, var(--bg-light-alt, #e9ecef) 100%);
}

/* Pricing cards */
.pricing-card {
    transition: all var(--transition-normal);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pricing-card-featured {
    transform: scale(1.02);
}

.pricing-card-featured:hover {
    transform: scale(1.02) translateY(-5px);
}

/* Price display */
.price-tag {
    line-height: 1;
}

.price-display {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

/* Empty state */
.empty-state {
    padding: 4rem 2rem;
}

.empty-state i {
    opacity: 0.5;
}

/* Breadcrumb customization */
.breadcrumb-item a {
    color: var(--text-secondary);
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

/* =====================
   Page Content Styles
   (for CMS pages, uses tenant variables)
   ===================== */

.page-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.page-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--brand-primary);
    color: var(--text-primary);
}

.page-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.page-content p {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}

.page-content ul, .page-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.page-content strong {
    color: var(--text-primary);
}

.page-content blockquote {
    border-left: 4px solid var(--brand-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
}

.page-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.page-content th, .page-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.page-content th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-primary);
}

.page-content tr:nth-child(even) {
    background: var(--bg-light);
}

.page-content a {
    color: var(--brand-primary);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content hr {
    margin: 2.5rem 0;
    border: none;
    border-top: 2px solid var(--border-color);
}

.page-content code {
    background: var(--bg-light);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--brand-accent, #d63384);
}

.page-content pre {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.page-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Page hero uses tenant primary color */
.page-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--bs-secondary, var(--brand-primary)) 100%);
    color: white;
    padding: 3rem 0;
    margin: -1.5rem -0.75rem 2rem -0.75rem;
}

@media (min-width: 576px) {
    .page-hero {
        margin: -1.5rem calc(-50vw + 50%) 2rem calc(-50vw + 50%);
        padding: 4rem 0;
    }
}

/* Page CTA section */
.page-cta {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

/* Auth pages divider */
.auth-divider::before,
.auth-divider::after {
    border-bottom-color: var(--border-color, #dee2e6);
}

.auth-divider span {
    color: var(--text-muted, #6c757d);
}
