/*
Theme Name: Kadence Child
Template:    kadence
Author:      Christopher OKeefe
Author URI:  Your Website Here
Description: Child theme for Kadence used for RestoreSTL development.
Version:     1.0.4
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags:        kadence
Text Domain: kadence-child
*/

/* ========================================
   RestoreSTL - Global Child Theme Styles
======================================== */

/* --- Body & Links (Assume Global Styles Set in Customizer) --- */
body {
    /* Base font/color set in Customizer */
  }
  a {
    /* Base link color set in Customizer */
  }
  a:hover {
    /* Base link hover color set in Customizer */
  }

  /* --- Headings (Assume Global Styles Set in Customizer) --- */
  h1, h2, h3, h4, h5, h6 {
    /* Base heading font/color set in Customizer */
  }

  /* --- Buttons --- */
  /* Base styles added via Customizer preferred */
  /* CSS below primarily targets custom classes and ensures overrides */

  .wp-block-button__link {
    /* Base padding, font, radius set in Customizer */
    transition: background-color 0.3s ease, transform 0.2s ease, border-color 0.3s ease, color 0.3s ease;
    transform: translateY(0);
    text-decoration: none !important;
    border: 2px solid transparent; /* Reserve space */
  }
  .wp-block-button__link:hover {
      transform: translateY(-2px); /* Add subtle lift to all buttons */
  }

  /* --- Primary CTA Button Style --- */
  /* Apply class 'cta-primary' */
  .wp-block-button__link.cta-primary,
  .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
    color: #1F1F1F !important; /* Near Black text */
    background-color: #ffc200 !important; /* Logo Yellow */
    border-color: #ffc200 !important;
  }
  .wp-block-button__link.cta-primary:hover,
  .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):hover {
    background-color: #e0ac00 !important; /* Darker Yellow */
    border-color: #e0ac00 !important;
    color: #1F1F1F !important;
  }

  /* --- Secondary Button Style (Outline) --- */
  /* Apply class 'cta-secondary' or use Kadence 'Outline' style */
  .wp-block-button__link.cta-secondary,
  .wp-block-button.is-style-outline .wp-block-button__link {
     background-color: transparent !important;
     color: #007A3D !important; /* Green text */
     border: 2px solid #007A3D !important; /* Green border */
  }
   .wp-block-button__link.cta-secondary:hover,
   .wp-block-button.is-style-outline .wp-block-button__link:hover {
     background-color: #007A3D !important; /* Green background on hover */
     color: #ffffff !important; /* White text on hover */
     border-color: #007A3D !important;
  }

  /* --- Section Heading Accent Line --- */
  /* Apply class 'section-heading-accent' to Heading blocks */
  .section-heading-accent::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background-color: #ffc200 !important; /* Logo Yellow */
    margin-top: 1rem;
    margin-bottom: 2.5rem;
    border-radius: 2px;
  }
  .has-text-align-center.section-heading-accent::after { margin-left: auto; margin-right: auto; }
  .has-text-align-left.section-heading-accent::after { margin-left: 0; }


/* ========================================
   Restore Assistant Chat Widget Styles - V2 (Layout Fix)
======================================== */

/* --- Overall Widget & Child Elements Box Sizing --- */
.restore-chat-widget,
.restore-chat-widget * {
  box-sizing: border-box;
}

/* --- Toggle Button --- */
.restore-chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007A3D; /* Green */
    color: #FFFFFF; /* White */
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}
.restore-chat-toggle-btn:hover {
    background-color: #005A2D; /* Darker Green */
    transform: scale(1.1);
}
.restore-chat-toggle-btn svg {
    fill: #FFFFFF;
    width: 28px;
    height: 28px;
    display: block;
}

/* --- Chat Widget Container --- */
.restore-chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 90%;
    max-width: 370px;
    height: 70vh; /* Main height driver */
    max-height: 550px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden initially */
    flex-direction: column; /* Children stack vertically */
    overflow: hidden;
    z-index: 9999;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}
.restore-chat-widget.visible {
    display: flex; /* Show using flex */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- Header --- */
.restore-chat-header {
    background-color: #1F1F1F; /* Near Black */
    color: #FFFFFF;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevent header shrinking */
}
.restore-chat-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
}
.restore-chat-close-btn {
    background: none; border: none; color: #FFFFFF; font-size: 1.5rem;
    line-height: 1; cursor: pointer; padding: 0 5px; opacity: 0.7; transition: opacity 0.2s ease;
}
.restore-chat-close-btn:hover { opacity: 1; }

/* --- Transcript Area --- */
.restore-chat-transcript {
    flex-grow: 1; /* *** KEY: Take up remaining vertical space *** */
    flex-shrink: 1; /* Allow shrinking if needed */
    flex-basis: 0;  /* Start height based on flex-grow */
    height: 0;      /* *** KEY: Explicit base height 0 for flex-grow *** */
    min-height: 50px; /* Prevent collapsing completely */
    overflow-y: auto; /* Allow scrolling */
    padding: 15px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #e0e0e0;
}
.restore-chat-transcript p { /* Message bubble base */
    margin: 0 0 12px 0; padding: 8px 12px; border-radius: 12px; line-height: 1.5;
    font-family: 'Inter', sans-serif; font-size: 0.95rem; max-width: 85%; word-wrap: break-word;
}
.restore-chat-transcript .user-message {
    background-color: #f5f5f5; color: #333333; margin-left: auto;
    border-bottom-right-radius: 2px; text-align: left;
}
.restore-chat-transcript .agent-message {
    background-color: #E6F2ED; color: #333333; margin-right: auto;
    border-bottom-left-radius: 2px; text-align: left;
}
 .restore-chat-transcript .error-message {
    background-color: #FFF0F0; color: #C00; text-align: center; font-style: italic;
    font-size: 0.9rem; max-width: 100%; border-radius: 4px; border: 1px solid #FDD;
}
/* Typing Indicator */
.restore-chat-transcript .typing-indicator span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; background-color: currentColor; border-radius: 50%; opacity: 0.4; animation: typing-dot-animation 1.4s infinite ease-in-out both; }
.restore-chat-transcript .typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.restore-chat-transcript .typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.restore-chat-transcript .typing-indicator span:nth-child(3) { animation-delay: 0s; }
@keyframes typing-dot-animation { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); opacity: 0.8; } }

/* --- Input Area --- */
.restore-chat-input-area {
    display: flex;
    align-items: flex-end; /* Align items to bottom (helps with textarea height) */
    padding: 10px;
    background-color: #f8f8f8;
    flex-shrink: 0; /* Prevent input area shrinking */
    border-top: 1px solid #e0e0e0;
}
.restore-chat-input { /* Textarea */
    flex-grow: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: none;
    margin-right: 8px;
    line-height: 1.4;
    overflow-y: auto !important; /* Ensure scroll override */
    /* Force initial height & prevent external inline styles */
    min-height: 40px !important; /* Set minimum height (e.g., match button) */
    height: auto !important; /* Override inline style, let content dictate height */
    /* max-height: 100px; /* Re-add max-height if needed */
}

.restore-chat-input:focus { outline: none; border-color: #007A3D; box-shadow: 0 0 0 2px rgba(0, 122, 61, 0.1); }
.restore-chat-send-btn { /* Send Button */
    background-color: #007A3D; color: #FFFFFF; border: none; border-radius: 4px; padding: 8px; cursor: pointer;
    transition: background-color 0.2s ease; height: 40px; width: 40px; display: flex; justify-content: center;
    align-items: center; flex-shrink: 0; /* Prevent button shrinking */
}
.restore-chat-send-btn:hover { background-color: #005A2D; }
.restore-chat-send-btn svg { fill: #FFFFFF; width: 20px; height: 20px; display: block; }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .restore-chat-widget {
        bottom: 0; right: 0; width: 100%; max-width: 100%; height: 100%; /* Or 100dvh */
        max-height: 100%; border-radius: 0; transform: translateY(100%); opacity: 1;
    }
    .restore-chat-widget.visible { transform: translateY(0); }
    .restore-chat-toggle-btn { bottom: 15px; right: 15px; width: 50px; height: 50px; }
    .restore-chat-toggle-btn svg { width: 24px; height: 24px; }
    .restore-chat-transcript p { max-width: 90%; }
}

/* Add other global styles from RestoreSTL v4 CSS below if needed */
/* ... */