/* app/assets/stylesheets/application.css */

/* --- Variables (from layout via BrandingService) ---
  These are defined in your application.html.erb <style> tag:
  :root {
    --brand-primary-color: <
%= BrandingService.primary_color %>;
    --brand-text-on-primary-color: <
%= BrandingService.text_on_primary_color %>;
    --brand-secondary-color: <
%= BrandingService.secondary_color %>;
    --brand-text-color: <
%= BrandingService.text_color %>;
    --brand-background-color: <
%= BrandingService.background_color %>;
  }
/* --- End Variables --- */

/* === Global Resets & Typography === */
body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.65;
    background-color: var(--brand-background-color);
    color: var(--brand-text-color);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  *, *::before, *::after {
    box-sizing: border-box;
  }
  
  .container {
    width: 90%;
    max-width: 1100px; /* Or 1200px for wider sites */
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px; /* Add some gutter */
    padding-right: 15px; /* Add some gutter */
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: var(--brand-primary-color); /* Headings use primary color */
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    font-weight: 600;
  }
  
  h1 { font-size: 2.5em; } /* Was 2.8em in hero, can adjust per section */
  h2 { font-size: 2em; }   /* Was 2.2em in features, can adjust */
  h3 { font-size: 1.5em; } /* Was 1.3em in features */
  
  p {
    margin-bottom: 1em;
  }
  
  a {
    color: var(--brand-secondary-color); /* Links use secondary color */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
  }
  
  a:hover {
    color: color-mix(in srgb, var(--brand-secondary-color) 70%, black); /* Darken secondary on hover */
    text-decoration: underline;
  }
  
  /* === Header & Navigation === */
  .site-header {
    background-color: var(--brand-primary-color);
    color: var(--brand-text-on-primary-color);
    padding: 15px 0; /* Increased padding slightly */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    position: sticky; /* Optional: make header sticky */
    top: 0;
    z-index: 1000;
  }
  
  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .site-logo-image {
    height: 45px; /* Slightly larger logo */
    width: auto;
    display: block;
  }
  
  .site-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
  }
  
  .site-navigation li {
    margin-left: 25px; /* Increased spacing */
  }
  
  .site-navigation a {
    color: var(--brand-text-on-primary-color);
    text-decoration: none;
    font-weight: 500; /* Was 500, can make bolder if needed */
    padding: 8px 0; /* More padding for click area */
    position: relative; /* For underline effect */
    transition: color 0.2s ease;
  }
  
  .site-navigation a::after { /* Underline effect */
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--brand-secondary-color); /* Accent color for underline */
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
  }
  
  .site-navigation a:hover::after,
  .site-navigation a.active::after { /* Style for active link if you add that logic */
    transform: scaleX(1);
    transform-origin: bottom left;
  }
  
  .site-navigation a:hover {
    color: var(--brand-text-on-primary-color); /* Keep color same, rely on underline */
    text-decoration: none; /* Remove default underline on hover */
  }
  
  
  /* === Main Content Area === */
  .page-content {
    padding-top: 40px;  /* More spacing */
    padding-bottom: 40px;
    min-height: calc(100vh - 75px - 80px - 80px); /* Adjust based on actual header/footer height and padding */
  }
  
  /* === Flash Messages === */
  .flash-notice, .flash-alert {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 6px;
    font-size: 1.05em;
    border: 1px solid transparent;
    text-align: center;
  }
  
  .flash-notice {
    background-color: #d1e7dd; /* Lighter green */
    color: #0f5132; /* Darker green text */
    border-color: #badbcc;
  }
  .flash-alert {
    background-color: #f8d7da; /* Lighter red */
    color: #842029; /* Darker red text */
    border-color: #f5c2c7;
  }
  
  /* === Home Page: Hero Section === */
  .hero-section {
    background-color: var(--brand-secondary-color);
    color: var(--brand-text-on-primary-color); /* Assuming secondary also contrasts with light text */
    padding: 80px 30px; /* More padding */
    text-align: center;
    border-radius: 10px; /* Softer corners */
    margin-bottom: 50px; /* More spacing */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  }
  
  .hero-section h1 {
    font-size: 3em; /* Make it pop */
    margin-bottom: 0.6em;
    color: var(--brand-text-on-primary-color);
    font-weight: 700;
  }
  
  .hero-section p {
    font-size: 1.25em; /* More readable */
    margin-bottom: 2em;
    max-width: 700px; /* Prevent very long lines */
    margin-left: auto;
    margin-right: auto;
  }
  
  /* === Buttons (General and CTAs) === */
  .cta-button, .cta-button-secondary, .form-actions input[type="submit"] {
    padding: 12px 30px; /* Consistent padding */
    text-decoration: none;
    font-weight: 600; /* Bolder */
    border-radius: 6px; /* Softer corners */
    transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.2s ease;
    display: inline-block; /* Allows margin and padding */
    border: none; /* Remove default border */
    cursor: pointer;
    font-size: 1.1em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  .cta-button:hover, .cta-button-secondary:hover, .form-actions input[type="submit"]:hover {
    transform: translateY(-2px); /* Slight lift on hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  }
  
  .hero-section .cta-button {
    background-color: var(--brand-text-on-primary-color); /* White or very light button on dark hero */
    color: var(--brand-secondary-color); /* Text color matches hero bg */
    border: 2px solid var(--brand-secondary-color); /* Optional border */
  }
  
  .hero-section .cta-button:hover {
    background-color: color-mix(in srgb, var(--brand-text-on-primary-color) 90%, black);
    color: var(--brand-primary-color); /* Change text on hover for contrast */
    border-color: var(--brand-primary-color);
  }
  
  /* === Home Page: Features Section === */
  .features-section {
    text-align: center;
    margin-bottom: 50px;
    padding: 30px 0;
  }
  
  .features-section h2 {
    font-size: 2.2em;
    color: var(--brand-primary-color);
    margin-bottom: 40px; /* More space below heading */
    font-weight: 700;
  }
  
  .feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px; /* Increased gap */
  }
  
  .feature-item {
    background-color: #ffffff; /* White cards */
    padding: 30px; /* More padding */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07); /* Softer shadow */
    text-align: center; /* Center content */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  }
  
  .feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  }
  
  .feature-icon {
    width: 50px; /* Adjust size */
    height: 50px;
    margin-bottom: 20px;
    fill: var(--brand-secondary-color); /* Use secondary color for icons */
    color: var(--brand-secondary-color);
  }
  .feature-icon-placeholder { /* If you use this fallback */
    width: 50px; height: 50px; margin-bottom: 20px; background-color: #e9ecef;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1.2em; color: var(--brand-secondary-color);
  }
  
  
  .feature-item h3 {
    color: var(--brand-primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4em; /* Slightly larger */
  }
  
  .feature-item p {
    font-size: 0.95em;
    color: #555; /* Slightly lighter text for descriptions */
  }
  
  
  /* === Home Page: CTA Section === */
  .cta-section {
    text-align: center;
    padding: 50px 20px;
    background-color: color-mix(in srgb, var(--brand-background-color) 95%, black); /* Slightly darker bg */
    margin-top: 50px;
    border-radius: 8px;
  }
  
  .cta-section h2 {
    font-size: 2em;
    color: var(--brand-primary-color);
    margin-bottom: 20px;
  }
  
  .cta-section p {
    font-size: 1.15em;
    margin-bottom: 30px;
    color: var(--brand-text-color);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .cta-button-secondary {
    background-color: var(--brand-primary-color);
    color: var(--brand-text-on-primary-color);
  }
  
  .cta-button-secondary:hover {
    background-color: color-mix(in srgb, var(--brand-primary-color) 80%, black);
  }
  
  /* === Footer Styling === */
  .site-footer {
    background-color: var(--brand-text-color); /* Dark footer */
    color: var(--brand-background-color); /* Light text on dark footer */
    padding: 30px 0; /* More padding */
    text-align: center;
    margin-top: 50px;
    font-size: 0.9em;
  }
  
  /* === Settings Page Specific Styles === */
  .settings-page-container {
    max-width: 750px; /* Slightly wider */
    margin: 40px auto; /* More top/bottom margin */
    padding: 30px 35px; /* More padding */
    background-color: #ffffff;
    border: 1px solid #dee2e6; /* Softer border */
    border-radius: 10px; /* Softer corners */
    box-shadow: 0 5px 20px rgba(0,0,0,0.07); /* Softer shadow */
  }
  
  .settings-page-container h1 {
    color: var(--brand-primary-color);
    margin-top: 0;
    margin-bottom: 30px; /* More space */
    text-align: center;
    font-size: 2em; /* Larger heading */
    font-weight: 700;
  }
  
  .settings-page-container p {
    text-align: center;
    margin-bottom: 25px;
    color: #6c757d;
  }
  
  .form-group {
    margin-bottom: 28px; /* More spacing */
  }
  
  .form-group label {
    display: block;
    margin-bottom: 10px; /* More space below label */
    font-weight: 600; /* Bolder labels */
    color: #495057; /* Darker label text */
    font-size: 1.05em;
  }
  
  .form-group input[type="text"],
  .form-group input[type="file"], /* Style file input roughly */
  .form-group input[type="color"] {
    width: 100%;
    padding: 12px 15px; /* More padding */
    border: 1px solid #ced4da;
    border-radius: 5px; /* Softer corners */
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  }
  
  .form-group input[type="text"]:focus,
  .form-group input[type="file"]:focus {
    border-color: var(--brand-secondary-color);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand-secondary-color) 25%, transparent);
    outline: none;
  }
  
  
  .form-group input[type="color"] {
    height: 50px; /* Taller color pickers */
    padding: 5px;
    cursor: pointer;
  }
  
  .form-group small {
    font-size: 0.9em;
    color: #6c757d;
    display: block;
    margin-top: 8px;
  }
  
  .form-actions {
    margin-top: 35px;
    text-align: center;
  }
  
  .form-actions input[type="submit"] {
    /* Using general button styles defined above */
    background-color: var(--brand-secondary-color);
    color: var(--brand-text-on-primary-color); /* Assuming this contrasts well */
  }
  
  .form-actions input[type="submit"]:hover {
    background-color: color-mix(in srgb, var(--brand-secondary-color) 80%, black);
  }
  
  /* Preview for logo on settings page */
  .form-group img {
    max-height: 60px;
    background: #f8f9fa;
    padding: 5px;
    margin-bottom: 10px;
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 4px;
  }