/* =================================
   SIMPLIFICO V2.5 - PROFESSIONAL CSS
   Color Scheme: Property Lead Gen (Navy Blue + Orange)
   Typography: Montserrat
   Navigation: Dropdown Menu
   ================================= */

/* Import Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

/* Root Variables - Property Lead Gen Color Scheme */
:root {
    /* Primary Colors - Navy Blues */
    --primary-navy: #0a2540;
    --rich-blue: #1e3a8a;
    --bright-blue: #3b82f6;
    
    /* Accent - Orange */
    --action-orange: #ff6b35;
    --action-hover: #f97316;
    
    /* Status */
    --success-green: #10b981;
    --warning: #fbbf24;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Text Colors */
    --text-dark: #0f172a;
    --text-medium: #475569;
    --text-light: #64748b;
    
    /* Backgrounds */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border-light: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12);
    
    /* Typography */
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-2xl: 64px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-navy);
    margin-bottom: 1rem;
}

h1 { font-size: 2.75rem; font-weight: 800; }
h2 { font-size: 2.25rem; font-weight: 700; }
h3 { font-size: 1.75rem; font-weight: 700; }
h4 { font-size: 1.375rem; font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text-medium);
    line-height: 1.7;
}

a {
    color: var(--bright-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--action-orange);
}

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

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Navigation */
.navbar {
    background: var(--primary-navy);
    padding: var(--spacing-sm) 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1); /* Makes logo white */
}

.navbar-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bg-white);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.navbar-link {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--bg-white);
    opacity: 0.9;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.navbar-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
}

.navbar-link.active {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

/* Dropdown Navigation */
.navbar-dropdown {
    position: relative;
    display: inline-block;
}

.navbar-dropdown-toggle {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--bg-white);
    opacity: 0.9;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-dropdown-toggle:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-dropdown-toggle::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.navbar-dropdown:hover .navbar-dropdown-toggle::after {
    transform: rotate(180deg);
}

.navbar-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px); /* Reduced gap from 8px to 4px */
    left: 0;
    background: var(--bg-white);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 1001;
    padding-top: 4px; /* Added padding to bridge the gap */
}

/* Critical: Keep dropdown visible when hovering over menu OR toggle */
.navbar-dropdown:hover .navbar-dropdown-menu,
.navbar-dropdown-menu:hover {
    display: block;
}

.navbar-dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-light);
}

.navbar-dropdown-item:last-child {
    border-bottom: none;
}

.navbar-dropdown-item:hover {
    background: var(--bg-light);
    color: var(--action-orange);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .navbar-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-navy);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }
    
    .navbar-links.active {
        display: flex;
    }
    
    .navbar-link {
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        color: var(--bg-white); /* White text in mobile menu */
    }
    
    .navbar-dropdown {
        width: 100%;
    }
    
    .navbar-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        color: var(--bg-white); /* White text */
    }
    
    .navbar-dropdown-menu {
        position: static;
        box-shadow: none;
        margin-top: 8px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: var(--radius-md);
    }
    
    .navbar-dropdown.active .navbar-dropdown-menu {
        display: block;
    }
    
    .navbar-dropdown-item {
        color: var(--bg-white); /* White text in dropdown */
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .navbar-dropdown-item:hover,
    .navbar-dropdown-item:active {
        background: var(--bg-white); /* White background on click */
        color: var(--action-orange); /* Orange text on click */
    }
    
    .btn-sm {
        width: 100%;
        margin-top: 8px;
    }
}

/* Buttons - Professional Style (Property Lead Gen) */
.btn {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}

/* Primary Button - Orange CTA */
.btn-primary {
    background: var(--action-orange);
    color: var(--bg-white);
    border-color: var(--action-orange);
    box-shadow: var(--shadow-sm);
}

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

/* Secondary Button - White with Blue Border (Property Lead Gen Style) */
.btn-secondary,
.btn-outline {
    background: var(--bg-white);
    color: var(--primary-navy);
    border-color: var(--primary-navy);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.btn-outline:hover {
    background: var(--primary-navy);
    color: var(--bg-white);
    border-color: var(--primary-navy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Success Button */
.btn-success {
    background: var(--success-green);
    color: var(--bg-white);
    border-color: var(--success-green);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-2px);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: var(--bg-white);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Button Sizes */
.btn-sm {
    font-size: 0.875rem;
    padding: 10px 20px;
}

.btn-lg {
    font-size: 1.125rem;
    padding: 16px 40px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

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

/* Card Stats */
.card-stat {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.card-stat-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    color: var(--bright-blue);
}

.card-stat-number {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--primary-navy);
    margin-bottom: 8px;
    line-height: 1;
}

.card-stat-label,
.card-stat-title {
    font-weight: 500;
    color: var(--text-medium);
    font-size: 0.95rem;
}

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

.form-label {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    display: block;
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    font-family: var(--font-primary);
    font-weight: 400;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--bright-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--bright-blue);
}

.form-check-label {
    font-weight: 400;
    cursor: pointer;
    color: var(--text-medium);
}

/* Badges */
.badge {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-primary {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge-info {
    background: #cffafe;
    color: #155e75;
}

/* Alerts */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #d1fae5;
    border-color: var(--success-green);
    color: #065f46;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-info {
    background: #cffafe;
    border-color: var(--info);
    color: #155e75;
}

/* Footer */
.footer {
    background: var(--primary-navy);
    color: var(--bg-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-2xl);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    opacity: 0.9;
}

.footer-bottom p {
    color: var(--bg-white);
    margin-bottom: 4px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-navy); }
.text-accent { color: var(--action-orange); }
.text-white { color: var(--bg-white); }
.bg-light { background: var(--bg-light); }
.bg-primary { background: var(--primary-navy); }

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--bright-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-medium);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 37, 64, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-medium);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-dark);
}

/* Search Bar */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 14px 48px 14px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--bright-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Responsive Typography */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    h1 { font-size: 2rem; line-height: 1.2; }
    h2 { font-size: 1.75rem; line-height: 1.2; }
    h3 { font-size: 1.375rem; line-height: 1.3; }
    
    .navbar-content {
        flex-wrap: nowrap;
        position: relative;
    }
    
    .navbar-links {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    
    .navbar-link {
        font-size: 0.875rem;
        padding: 6px 12px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 14px 32px;
        font-size: 1rem;
    }
    
    .grid-2, .grid-3, .grid-4 { 
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    section {
        padding: 40px 0 !important;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .btn-lg {
        font-size: 0.95rem;
        padding: 12px 24px;
    }
    
    section {
        padding: 32px 0 !important;
    }
}

/* Print Styles */
@media print {
    .navbar, .footer, .btn {
        display: none;
    }
}
