/* Dark mode support */
:root {
    /* Sherwin-Williams Color Palette */
    --primary-color: #5C4D3C;        /* Status Bronze SW 7034 */
    --secondary-color: #4B302A;      /* Rojo Marron SW 9182 */
    --accent-color: #8C7B6B;         /* Lighter bronze for accents */
    --text-color: #343B36;           /* Jasper SW 6216 */
    --light-gray: #F9F6F2;           /* Lighter variant of Westhighland White */
    --surface-color: #FFFFFF;
    --shadow-sm: 0 2px 4px rgba(52, 59, 54, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(52, 59, 54, 0.12);
    --shadow-lg: 0 10px 15px -3px rgba(52, 59, 54, 0.15);
    --transition-base: all 0.3s ease;
    --bg-color: #F3EEE3;             /* Westhighland White SW 7566 */
    --border-color: #E8E0D5;
    --muted-color: #6B685F;
    --input-bg: #FFFFFF;
    --input-text: #343B36;
    --input-border: #D4CFC4;
    --table-header-bg: #F9F6F2;
    --table-row-hover: #F0EBE0;
    --card-text: #4B4842;
    --subtext-color: #6B685F;
    --toggler-color: rgba(52, 59, 54, 0.7);
    --btn-close-filter: none;
    --hero-overlay: rgba(52, 59, 54, 0.6);
    --gradient-overlay: linear-gradient(45deg, rgba(92, 77, 60, 0.5), rgba(75, 48, 42, 0.5));
}

[data-theme="dark"] {
    --primary-color: #8C7B6B;        /* Lighter bronze for dark mode */
    --secondary-color: #A68A79;
    --accent-color: #C4B5A8;
    --text-color: #F3EEE3;
    --light-gray: #2A2D2B;
    --surface-color: #1A1D1B;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --bg-color: #0F1211;
    --border-color: #3A3D3B;
    --muted-color: #9CA09D;
    --input-bg: #2A2D2B;
    --input-text: #F3EEE3;
    --input-border: #4A4D4B;
    --table-header-bg: #2A2D2B;
    --table-row-hover: #343736;
    --card-text: #D8D4CE;
    --subtext-color: #A8ACA9;
    --toggler-color: rgba(243, 238, 227, 0.85);
    --btn-close-filter: invert(1) grayscale(100%) brightness(200%);
    --hero-overlay: rgba(0, 0, 0, 0.75);
    --gradient-overlay: linear-gradient(45deg, rgba(140, 123, 107, 0.7), rgba(166, 138, 121, 0.7));
}

/* Update navbar toggler for dark mode */
.navbar-toggler {
    color: var(--toggler-color);
    border-color: var(--toggler-color);
    padding: 0.5rem;
    border: 1px solid var(--toggler-color);
    transition: var(--transition-base);
}

.navbar-toggler:hover {
    background-color: var(--surface-color);
}

.navbar-toggler-icon {
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
}

[data-theme="dark"] .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.75);
}

[data-theme="dark"] .navbar-toggler-icon {
    color: rgba(255, 255, 255, 0.75);
}

/* Update text styles for better visibility */
.feature-card p,
.testimonial-card p,
.card-text,
.text-muted,
.card .text-muted,
.form-text {
    color: var(--card-text) !important;
}

.small,
.text-secondary,
.meta-text,
.subtext {
    color: var(--subtext-color) !important;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    line-height: 1.7;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Form Controls */
.form-control {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
}

.form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    color: var(--input-text);
}

.form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
}

/* Add smooth transitions for theme switching */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    line-height: 1.7;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Update card and interactive elements for better dark mode visibility */
.card {
    background-color: var(--surface-color);
    border-color: var(--border-color);
    transition: var(--transition-base);
}

.dropdown-menu {
    background-color: var(--surface-color);
    border-color: var(--border-color);
}

.dropdown-item {
    color: var(--text-color);
}

.dropdown-item:hover {
    background-color: var(--table-row-hover);
    color: var(--primary-color);
}

.btn-close {
    filter: var(--btn-close-filter);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Tables */
.table {
    color: var(--text-color);
}

.table thead th {
    background-color: var(--table-header-bg);
    color: var(--text-color);
}

.table tbody tr:hover {
    background-color: var(--table-row-hover);
}

/* Navigation */
.navbar {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
    transition: var(--transition-base);
}

.navbar-cream {
    background-color: #F9F4F0;
}

[data-theme="dark"] .navbar-cream {
    background-color: #1A1D1B;
}

.navbar-logo-item {
    display: flex;
    align-items: center;
}

.navbar-logo-inline {
    height: 90px;
    width: auto;
    transition: var(--transition-base);
}

.navbar-logo-inline:hover {
    transform: scale(1.02);
}

/* Mobile navbar styling */
.mobile-navbar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
}

.mobile-logo-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.navbar-logo-mobile {
    height: 180px;
    width: auto;
}

.mobile-navbar-header .navbar-toggler {
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    border-radius: 12px;
}

.navbar-toggler-baby-icon {
    font-size: 1.5rem;
    color: white;
}

@media (max-width: 991px) {
    .navbar-collapse {
        text-align: center;
    }
    
    .navbar-nav {
        align-items: center;
    }
}

/* Update existing styles with CSS variables */
.navbar-brand {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    text-transform: none;
    position: relative;
    display: inline-block;
    transition: var(--transition-base);
}

.navbar-logo {
    height: 70px;
    width: auto;
    transition: var(--transition-base);
}

.navbar-brand:hover .navbar-logo {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .navbar-logo {
        height: 55px;
    }
}

.nav-link {
    font-weight: 500;
    transition: var(--transition-base);
    position: relative;
    color: var(--text-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition-base);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Feature Cards */
.feature-card {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    text-align: center;
    height: 100%;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: var(--transition-base);
}

.feature-card:hover i {
    transform: scale(1.1);
    color: var(--accent-color);
}

.feature-card h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--muted-color);
    margin-bottom: 0;
}

/* Testimonial Cards */
.testimonial-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    height: 100%;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

.testimonial-rating i {
    color: #fbbf24;
}

.testimonial-card p {
    font-style: italic;
    color: var(--text-color);
}

.testimonial-card cite {
    color: var(--primary-color);
    font-weight: 500;
    font-style: normal;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: var(--transition-base);
}

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

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

.btn-outline-light:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* CTA Section */
.cta {
    background-color: var(--surface-color);
    padding: 5rem 0;
    margin-top: 4rem;
}

.cta h2 {
    font-weight: 700;
    color: var(--text-color);
}

/* Footer */
.footer {
    background-color: var(--surface-color) !important;
    padding: 4rem 0 3rem;
    margin-top: 6rem;
}

.footer h5 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-base);
}

.theme-toggle:hover {
    color: var(--primary-color);
}

.theme-toggle i {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 6rem 0;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .feature-card {
        padding: 2rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card, .testimonial-card {
    animation: fadeInUp 0.5s ease-out;
}

.feature-card:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.4s;
}

/* Pricing Cards */
.pricing-card {
    background: var(--surface-color);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.pricing-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.pricing-card .price {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin: 1.5rem 0;
}

/* Contact Form */
.contact-form {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.contact-info {
    padding: 2.5rem;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

/* Footer */
.footer {
    background-color: var(--surface-color) !important;
    padding: 4rem 0 3rem;
    margin-top: 6rem;
}

.footer h5 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 100px 0;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .pricing-card.featured {
        transform: none;
        margin: 2rem 0;
    }
}

/* Map Styles */
.map-info-window {
    padding: 1rem;
    max-width: 250px;
}

.map-info-window h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Additional Modern Utilities */
.shadow-hover {
    transition: box-shadow 0.3s ease;
}

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

.text-gradient {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.area-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.area-card.active {
    border-left: 4px solid var(--primary-color);
    background-color: var(--light-gray);
}

.map-info-window {
    padding: 10px;
    max-width: 200px;
}

.map-info-window h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.area-list {
    list-style: none;
    padding-left: 0;
}

.area-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.area-list li:last-child {
    border-bottom: none;
}

.selected-slot {
    background-color: rgba(76, 175, 80, 0.3);
    border: 2px solid #4CAF50;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

.fc-timegrid-slot {
    cursor: pointer;
}

.fc-timegrid-slot:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.fc-non-business {
    background-color: rgba(0, 0, 0, 0.05);
    cursor: not-allowed;
}

#appointment_date[readonly] {
    background-color: #f8f9fa;
    cursor: default;
}

#appointment_date.has-selection {
    background-color: #e8f5e9;
    border-color: #4CAF50;
    color: #2e7d32;
    font-weight: 500;
}

/* Hero section with improved styling */
.hero-section {
    position: relative;
    background: url('/static/images/hero-bg-storybook.png') center/cover no-repeat;
    padding: 60px 0 100px;
    margin-bottom: 4rem;
    color: var(--text-color);
    min-height: 85vh;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(249,246,242,0.9) 50%, rgba(243,238,227,0.95) 100%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(85vh - 120px);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.hero-content h1 {
    color: var(--primary-color);
    text-shadow: none;
}

.hero-headline {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.hero-content .lead {
    color: var(--secondary-color);
    font-weight: 600;
    letter-spacing: 2px;
}

.hero-content p {
    color: var(--text-color);
}

[data-theme="dark"] .hero-section::before {
    background: linear-gradient(180deg, rgba(15,18,17,0.9) 0%, rgba(26,29,27,0.92) 50%, rgba(15,18,17,0.95) 100%);
}

[data-theme="dark"] .hero-content h1 {
    color: var(--primary-color);
}

[data-theme="dark"] .hero-content .lead {
    color: var(--accent-color);
}

[data-theme="dark"] .hero-content p {
    color: var(--text-color);
}

/* Update map styles for dark mode*/
[data-theme="dark"] .map-info-window {
    background-color: var(--surface-color);
    color: var(--text-color);
}

[data-theme="dark"] .map-info-window h4 {
    color: var(--primary-color);
}

/* Update service cards for dark mode */
[data-theme="dark"] .service-card {
    background-color: var(--surface-color);
}

[data-theme="dark"] .service-features li {
    color: var(--text-color);
}

/* Update form elements for dark mode */
[data-theme="dark"] .form-control::placeholder {
    color: var(--muted-color);
}

[data-theme="dark"] .input-group-text {
    background-color: var(--light-gray);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Add smooth transitions for theme switching */
.hero-section,
.service-card,
.form-control,
.input-group-text,
.map-info-window {
    transition: all 0.3s ease;
}

/* Footer Brand Styling */
.footer h5.text-gradient {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ============================================ */

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }
    
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-collapse {
        background: var(--surface-color);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 0.5rem;
        box-shadow: var(--shadow-md);
    }
    
    .navbar-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.875rem 1rem !important;
        border-radius: 0.5rem;
    }
    
    .nav-link:hover {
        background: var(--light-gray);
    }
}

/* Mobile Hero Section */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0 60px;
        background-attachment: scroll;
        min-height: 60vh;
    }
    
    .hero-section .container {
        min-height: calc(60vh - 80px);
    }
    
    .hero-section h1,
    .hero-content h1,
    .hero-headline {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-section .lead,
    .hero-content .lead {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .hero-section p,
    .hero-content p {
        font-size: 0.9375rem;
    }
    
    .hero-section .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .hero-section .d-flex.gap-3,
    .hero-content .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.75rem !important;
    }
}

/* Mobile Feature Cards */
@media (max-width: 768px) {
    .feature-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .feature-card i {
        font-size: 2rem;
    }
    
    .feature-card h3 {
        font-size: 1.125rem;
    }
}

/* Mobile Testimonials */
@media (max-width: 768px) {
    .testimonial-card {
        padding: 1.25rem;
    }
    
    .testimonial-card p {
        font-size: 0.9375rem;
    }
}

/* Mobile Footer */
@media (max-width: 768px) {
    .footer {
        padding: 2.5rem 0 2rem;
        margin-top: 3rem;
    }
    
    .footer .col-lg-2,
    .footer .col-lg-3,
    .footer .col-lg-4 {
        margin-bottom: 1.5rem;
    }
    
    .footer h5 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .footer ul li {
        margin-bottom: 0.5rem;
    }
    
    .footer .social-icons {
        margin-top: 1rem;
    }
}

/* Mobile Contact & Forms */
@media (max-width: 768px) {
    .contact-form,
    .contact-info {
        padding: 1.5rem;
    }
    
    .contact-info li {
        margin-bottom: 1rem;
    }
}

/* Mobile Tables */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
}

/* Mobile Cards */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
}

/* Mobile Modals */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 0.75rem 1rem;
    }
}

/* Mobile Pricing */
@media (max-width: 768px) {
    .pricing-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .pricing-card .price {
        font-size: 2rem;
    }
}

/* Mobile Services */
@media (max-width: 768px) {
    .service-card {
        margin-bottom: 1rem;
    }
    
    .service-card img {
        height: 180px;
        object-fit: cover;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .btn-lg {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
}

.container, .container-fluid, .row {
    max-width: 100%;
}

/* iOS input styling */
input, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0.5rem;
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}