/*
Theme Name: CREHQ Modern
Theme URI: https://crehq.com
Author: GroundRoof
Author URI: https://groundroof.com
Description: A modern SaaS-inspired WordPress theme for CREHQ.com, featuring a clean, Crunchbase-like design. Includes support for membership sign-ups, requirement database, blog posts, company profiles, advanced search functionality, and more. Built with Tailwind CSS for a responsive, modern user experience.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crehq-modern
Tags: custom-header, custom-menu, featured-images, threaded-comments, translation-ready, blog, business, portfolio

CREHQ Modern is a custom WordPress theme designed to provide a modern, professional SaaS experience
inspired by leading platforms like Crunchbase. It maintains all essential CREHQ functionality while
delivering a fresh, contemporary look and feel.
*/

/* ====================================
   CREHQ Modern Color Palette
   Professional SaaS aesthetic for Commercial Real Estate
   ==================================== */

/*
  Primary Colors (Deep Navy/Slate):
  - Navy Dark: #0F172A (slate-900)
  - Navy: #1E293B (slate-800)
  - Slate: #334155 (slate-700)

  Accent Colors (Vibrant Coral/Teal):
  - Coral: #FF6B6B (vibrant coral)
  - Coral Dark: #E85A5A
  - Teal: #14B8A6 (teal-500)
  - Teal Dark: #0D9488

  Supporting Colors:
  - Sky Blue: #0EA5E9 (sky-500)
  - Amber: #F59E0B (amber-500)

  Neutrals:
  - Near Black: #0A0F1E
  - Dark Gray: #1F2937
  - Medium Gray: #6B7280
  - Light Gray: #E5E7EB
  - Very Light: #F9FAFB
  - White: #FFFFFF
*/

:root {
    /* Primary Colors - Navy/Slate */
    --color-primary-dark: #0F172A;
    --color-primary: #1E293B;
    --color-primary-light: #334155;

    /* Accent Colors */
    --color-accent-coral: #FF6B6B;
    --color-accent-coral-dark: #E85A5A;
    --color-accent-teal: #14B8A6;
    --color-accent-teal-dark: #0D9488;

    /* Supporting */
    --color-sky: #0EA5E9;
    --color-amber: #F59E0B;

    /* Neutrals */
    --color-near-black: #0A0F1E;
    --color-dark: #1F2937;
    --color-gray: #6B7280;
    --color-light-gray: #E5E7EB;
    --color-very-light: #F9FAFB;
    --color-white: #FFFFFF;

    /* Semantic Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    --gradient-accent: linear-gradient(135deg, #FF6B6B 0%, #14B8A6 100%);
    --gradient-hero: linear-gradient(135deg, #1E293B 0%, #334155 50%, #0F172A 100%);
    --gradient-coral: linear-gradient(135deg, #FF6B6B 0%, #E85A5A 100%);
    --gradient-teal: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #E5E7EB;

    /* Text Colors */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;

    /* Border Colors */
    --border-light: #E5E7EB;
    --border-medium: #CBD5E1;
    --border-dark: #94A3B8;

    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ====================================
   Dark Mode Colors
   ==================================== */

[data-theme="dark"] {
    /* Override colors for dark mode */
    --color-primary-dark: #E5E7EB;
    --color-primary: #CBD5E1;
    --color-primary-light: #94A3B8;

    /* Background Colors */
    --bg-primary: #0A0F1E;
    --bg-secondary: #0F172A;
    --bg-tertiary: #1E293B;

    /* Text Colors */
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;

    /* Border Colors */
    --border-light: #1E293B;
    --border-medium: #334155;
    --border-dark: #475569;

    /* Gradients adjusted for dark mode */
    --gradient-hero: linear-gradient(135deg, #1E293B 0%, #334155 50%, #475569 100%);
}

/* ====================================
   Typography
   ==================================== */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Prevent SVG sizing issues */
svg {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Override for SVGs that need explicit sizing */
svg.h-5,
svg.w-5 {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* ====================================
   Custom Button Styles
   ==================================== */

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-white);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-accent {
    background-color: var(--color-accent-teal);
    color: var(--color-white);
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background-color: #0D9488;
    transform: translateY(-2px);
}

/* ====================================
   Search Bar Enhancements
   ==================================== */

.search-input-enhanced {
    transition: all 0.3s ease;
}

.search-input-enhanced:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* ====================================
   Card Hover Effects
   ==================================== */

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ====================================
   Gradient Text
   ==================================== */

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ====================================
   Custom Utilities
   ==================================== */

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

.bg-gradient-secondary {
    background: var(--gradient-secondary);
}

.bg-gradient-hero {
    background: var(--gradient-hero);
}

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

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--color-accent-teal);
    outline-offset: 2px;
}

/* ====================================
   Premium/Membership UI
   ==================================== */

.premium-content-gate {
    position: relative;
}

.premium-blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        rgba(255, 255, 255, 0.95) 100%
    );
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

[data-theme="dark"] .premium-blur-overlay {
    background: linear-gradient(to bottom, 
        rgba(10, 15, 30, 0) 0%, 
        rgba(10, 15, 30, 0.8) 50%, 
        rgba(10, 15, 30, 0.95) 100%
    );
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-coral);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.unlock-cta {
    padding: 1rem 2rem;
    background: var(--gradient-accent);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
}

.unlock-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(255, 107, 107, 0.4);
}

/* ====================================
   Tabbed Interface
   ==================================== */

.tab-navigation {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}

.tab-button {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-button:hover {
    color: var(--color-accent-coral);
    border-bottom-color: var(--color-accent-coral);
}

.tab-button.active {
    color: var(--color-accent-coral);
    border-bottom-color: var(--color-accent-coral);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====================================
   Dark Mode Toggle
   ==================================== */

.dark-mode-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.dark-mode-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

[data-theme="dark"] .dark-mode-toggle svg.sun-icon {
    transform: rotate(180deg);
}

.dark-mode-toggle svg.moon-icon {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle svg.sun-icon {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle svg.moon-icon {
    display: block;
}

/* ====================================
   Filter System
   ==================================== */

.filter-sidebar {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1.5rem;
    position: sticky;
    top: 6rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-option:hover {
    background: var(--bg-tertiary);
}

.filter-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-medium);
    border-radius: 0.25rem;
    accent-color: var(--color-accent-coral);
}

.filter-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* ====================================
   View Switcher
   ==================================== */

.view-switcher {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.view-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-button:hover {
    color: var(--text-primary);
}

.view-button.active {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .view-button.active {
    background: var(--bg-tertiary);
}

/* ====================================
   Stats Counter
   ==================================== */

.stats-counter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ====================================
   Company Card Variations
   ==================================== */

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.company-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.company-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.company-table thead {
    background: var(--bg-secondary);
}

.company-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-light);
}

.company-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.company-table tbody tr {
    transition: all 0.2s ease;
}

.company-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* ====================================
   Loading States
   ==================================== */

.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-light);
    border-top-color: var(--color-accent-coral);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ====================================
   Utility Classes
   ==================================== */

.text-gradient-coral {
    background: var(--gradient-coral);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-teal {
    background: var(--gradient-teal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-coral {
    background: rgba(255, 107, 107, 0.1);
    color: var(--color-accent-coral);
}

.badge-teal {
    background: rgba(20, 184, 166, 0.1);
    color: var(--color-accent-teal);
}

.badge-gray {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ====================================
   Responsive Utilities
   ==================================== */

@media (max-width: 768px) {
    .stats-counter {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .company-grid {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
    }

    .tab-navigation {
        gap: 0.25rem;
    }

    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .dark-mode-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }
}

/* ====================================
   Print Styles
   ==================================== */

@media print {
    .dark-mode-toggle,
    .filter-sidebar,
    .view-switcher,
    header,
    footer {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .premium-blur-overlay {
        display: none !important;
    }
}
