/* ==========================================================================
   Table of Contents
   ========================================================================== */

/*
1. CSS Custom Properties
2. Reset and Base Styles
3. Utility Classes
4. Page Layout
   4.1 Page Wrapper
   4.2 Container
5. Navigation Components
6. User Input Section
7. Panel Components
8. Collapsible Content
9. Checkbox Components
10. Strain Card Components
   10.1 Header
   10.2 Body
   10.3 Match Strength
   10.4 Effect Strength
   10.5 Actions and Feedback
11. Button Styles
12. Accessibility
13. Animation Keyframes
14. Media Queries
*/

/* ==========================================================================
   CSS Custom Properties
   Global variables for consistent theming and easier maintenance
   ========================================================================== */
   :root {
    /* Color Scheme */
    --color-primary: #32a852;
    --color-primary-dark: #268641;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;
    
    /* Background Colors */
    --bg-light: #f8f9fa;
    --bg-lighter: #e9ecef;
    --bg-white: #ffffff;
    
    /* Text Colors */
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    
    /* Border Colors */
    --border-light: #e9ecef;
    --border-medium: #dee2e6;
    
    /* Effect Strength Colors */
    --strength-high: linear-gradient(to right, #28a745, #34ce57);
    --strength-medium: linear-gradient(to right, #ffc107, #ffcd39);
    --strength-low: linear-gradient(to right, #dc3545, #e4606d);
    
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-duration: 0.3s;
    --transition-easing: ease;
    --transition-standard: all 0.2s ease;
}

/* Replace individual transitions with the variable */
.btn,
.nav-link,
.checkbox-container,
.feedback-btn {
    transition: var(--transition-standard);
}

/* ==========================================================================
   2. Reset and Base Styles
   ========================================================================== */
   html {
    box-sizing: border-box;
  }
  
  *,
  *::before,
  *::after {
    box-sizing: inherit;
  }
  
  body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: var(--text-primary);
    margin: 0;
  }
  
  img {
    max-width: 100%;
  }

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    max-width: 1200px;
    width: 95%;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    flex-grow: 1;
    flex-direction: column;
}

.section {
    width: 100%;
    position: relative;
}

#input-section {
    order: 1;
    background: transparent;
    position: relative;
    z-index: 1;
    isolation: isolate;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    border: none;
}

#input-section > * {
    background: transparent;
}

#input-section::after,
#input-section::before {
    display: none;
}

#preferences-panel, 
#aversions-panel {
    order: 2;
}

.button-container {
    margin-top: 20px;
    text-align: center;
}

#preferences-form {
    position: relative;
}

#save-preferences {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#save-preferences:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


#save-preferences.saving {
    background-color: var(--accent-color);
}

#save-preferences.success {
    background-color: #28a745;
}

/* Analysis Feedback Section */
#analysis-feedback {
    display: block;
    order: 3;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analysis-section {
    margin-bottom: 20px;
}

/* Initially hide the section titles */
.analysis-section h3 {
    display: none;
}

/* Show titles when feedback is displayed */
.analysis-feedback:not(.hidden) .analysis-section h3 {
    display: block;
}

/* Target the specific section headings directly */
.analysis-section h3,
#detected-characteristics h3,
#matching-factors h3,
#recommendation-summary h3 {
    display: none !important;
}

/* Show headings only when parent contains feedback items */
.analysis-section:has(.feedback-item) h3,
#detected-characteristics:has(.feedback-item) h3,
#matching-factors:has(.feedback-item) h3,
#recommendation-summary:has(.feedback-item) h3 {
    display: block !important;
}

.fas.fa-lightbulb {
    margin-right: 8px;
}

#recommendations-panel {
    order: 4;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

/* ==========================================================================
   Navigation Components
   ========================================================================== */
.nav-container {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    padding: 10px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--color-primary);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.nav-link:hover {
    background-color: var(--bg-lighter);
}

.nav-link i {
    font-size: 1.2em;
}

.user-info {
    color: var(--color-primary);
    margin-right: 15px;
    font-weight: 500;
}

#logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    transition: transform var(--transition-medium);
}

#logo:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   User Input Section
   ========================================================================== */
#input-section {
    margin-bottom: 20px;
    background: transparent;
    position: relative;
}

#user-input {
    width: 100%;
    height: 100px;
    margin-bottom: 15px;
    padding: 15px;
    font-size: 1rem;
    border: 2px solid var(--border-medium);
    border-radius: 8px;
    resize: vertical;
    transition: border-color var(--transition-fast);
    background: var(--bg-white);
}

#user-input:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* ==========================================================================
   Panel Components
   ========================================================================== */
.panel {
    margin: 20px 0;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--bg-light);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.panel-header:hover {
    background-color: var(--bg-lighter);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.collapse-toggle {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform var(--transition-medium);
    padding: 0 10px;
    display: inline-block;
    cursor: pointer; 
}

.panel-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height var(--transition-medium);
    display: flex;
    flex-direction: column;
    gap: 10px; /* Add spacing between child elements */
}

.panel.collapsed .panel-content {
    max-height: 0;
    padding: 0;
    margin: 0;
}

.panel.collapsed .collapse-toggle {
    transform: rotate(-90deg);
    transition: transform 0.3s ease-in-out;
    display: inline-block;
}


/* ==========================================================================
   Checkbox Components
   ========================================================================== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px;
}

.checkbox-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    transition: all var(--transition-fast);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.checkbox-container:hover {
    background: var(--bg-lighter);
    transform: translateY(-2px);
}

.checkbox-container input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    margin: 0;
    cursor: pointer;
    position: relative;
    background: white;
}

.checkbox-container input[type="checkbox"]:checked {
    background-color: var(--color-primary);
}

.checkbox-container input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-icon {
    font-size: 1.2em;
    min-width: 24px;
    text-align: center;
}

.checkbox-text {
    font-size: 0.95em;
    color: var(--text-secondary);
}

/* ==========================================================================
   Effect Strength Components
   ========================================================================== */
.effects-section {
    margin-bottom: var(--space-lg);
}

.effects-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.effects-list.compact {
    max-width: 300px;
}

.effect-item.horizontal {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    height: 20px;
}

.effect-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    background: var(--bg-light);
    border-radius: 6px;
    transition: transform var(--transition-fast);
}

.effect-name {
    min-width: 120px;
    font-size: 0.95em;
    color: var(--text-secondary);
    font-weight: 500;
}

.effect-strength-bar {
    height: 12px;
    margin-left: 8px;
}

.strength-fill {
    height: 100%;
    transition: width var(--transition-medium);
    border-radius: inherit;
}

.strength-fill[data-strength="high"] {
    background: linear-gradient(to right, #28a745, #34ce57);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}
    
.strength-fill[data-strength="medium"] {
    background: linear-gradient(to right, #ffc107, #ffcd39);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}
    
.strength-fill[data-strength="low"] {
    background: linear-gradient(to right, #dc3545, #e4606d);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

/* ==========================================================================
   Match Strength Components
   ========================================================================== */
.match-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.match-label {
    flex-shrink: 0;
    min-width: 60px;
}

.match-bar {
    flex-grow: 1;
    height: 12px;
    background: var(--bg-lighter);
    border-radius: 6px;
    position: relative;
    max-width: 200px;
    margin-right: 50px;
}

.match-fill {
    position: absolute;
    height: 100%;
    border-radius: 6px;
    transition: width var(--transition-medium);
}

.match-fill-high {
    background: var(--strength-high);
}

.match-fill-medium {
    background: var(--strength-medium);
}

.match-fill-low {
    background: var(--strength-low);
}

.match-text {
    position: absolute;
    right: -45px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ==========================================================================
   Strain Card Components
   ========================================================================== */
.recommendation-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform var(--transition-fast);
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.recommendation-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.strain-icon {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.strain-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    background-color: var(--bg-light);
    border: 2px solid var(--border-light);
}

.strain-info {
    flex-grow: 1;
}

.strain-info h3 {
    margin: 0 0 8px 0;
    color: var(--color-primary);
}

.recommendation-body {
    padding: 15px;
}

.strain-type {
    margin: 0 0 10px 0;
    color: var(--text-muted);
}

.strain-description {
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.strain-details {
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.compound-profiles {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.compound-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compound-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
}

.cannabinoid {
    background: #e3f2fd;
    color: #1565c0;
}

.terpene {
    background: #f3e5f5;
    color: #7b1fa2;
}


/* ==========================================================================
   Feedback and Interactive Components
   ========================================================================== */
.feedback-buttons {
    display: flex;
    gap: 8px;
}

.feedback-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.feedback-btn i {
    font-size: 1.1em;
}

.feedback-btn.thumbs-up:hover {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.feedback-btn.thumbs-down:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

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

.feedback-list {
    list-style: none;
    padding: 0;
}

.feedback-list li {
    margin-bottom: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

.strain-favorite, .strain-feedback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px; /* Add spacing between items */
    padding: 10px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.strain-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    visibility: visible;
}

.strain-favorite i.fa-heart {
    color: var(--color-danger);
    font-size: 1.2em;
}

.strain-favorite:hover {
    background: var(--bg-lighter);
    transform: translateY(-2px);
}

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

.btn,
.feedback-btn,
#voice-button,
#reset-button {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -webkit-user-select: none;
    user-select: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover,
.feedback-btn:hover,
#voice-button:hover,
#reset-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn:active,
.feedback-btn:active,
#voice-button:active,
#reset-button:active {
    transform: translateY(1px);
}

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

#buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    mix-blend-mode: normal;
    isolation: isolate;
}

/* ==========================================================================
   Voice and Reset Button Styles
   ========================================================================== */
#buttons::before,
#buttons::after {
    display: none;
}

#voice-button, #reset-button {
    width: 44px;
    height: 44px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
}
  .recording {
      background-color: #e74c3c !important; /* Bright red for recording */
      color: white !important;
      animation: pulse 1.5s infinite;
  }
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#voice-button:hover:not(.recording) {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}
#voice-button i, #reset-button i {
    font-size: 1.2em;
    color: white;
}

/* ==========================================================================
   Effect Bars and Strength Indicators
   ========================================================================== */
.effect-bar {
    flex-grow: 1;
    height: 8px;
    background: var(--bg-lighter);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.effect-fill {
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: inherit;
    transition: width var(--transition-medium);
}

/* Effect strength variations */
.effect-fill[data-strength="high"] {
    background: var(--strength-high);
}

.effect-fill[data-strength="medium"] {
    background: var(--strength-medium);
}

.effect-fill[data-strength="low"] {
    background: var(--strength-low);
}

/* Match Score Display */
.match-score-display {
    background: #f5f5f5;
    border-radius: 50%;
    padding: 10px;
    text-align: center;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 15px;
}

.score-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #2196F3;
}

.score-label {
    font-size: 0.8em;
    color: #666;
}

/* Effects Bars */
.effect-strength-bar {
    height: 12px;
    background: #eee;
    border-radius: 6px;
    position: relative;
    width: 150px;
    margin-left: 10px;
}

.strength-fill {
    height: 100%;
    border-radius: 6px;
    position: relative;
}

.strength-fill.high { background: #4CAF50; }
.strength-fill.medium { background: #FFC107; }
.strength-fill.low { background: #FF5722; }

.strength-value {
    position: absolute;
    right: -35px;
    top: -2px;
    font-size: 0.8em;
    color: #666;
}

/* User Feedback Section */
.feedback-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#recommendation-summary .feedback-item {
    background: #e3f2fd;
    border-left-color: #2196F3;
}

#detected-characteristics .feedback-item {
    background: #f3e5f5;
    border-left-color: #9c27b0;
}

#matching-factors .feedback-item {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.recommendation-summary {
    margin-top: 15px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 4px;
    font-weight: 500;
}


/* ==========================================================================
   Feedback and Favorite Buttons
   ========================================================================== */
.strain-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.feedback-btn, 
.favorite-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.feedback-btn i, 
.favorite-btn i {
    font-size: 1.2em;
}

.feedback-btn:hover {
    background: var(--bg-lighter);
}

.feedback-btn.positive:hover {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.feedback-btn.negative:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.favorite-btn:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.favorite-btn.active {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* ==========================================================================
   Animation Keyframes
   ========================================================================== */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 1024px) {
    .container {
        width: 90%;
        padding: 15px;
    }
    
    .checkbox-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        margin: 10px 0;
        padding: 10px;
    }

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

    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    #logo {
        width: 60px;
        height: 60px;
    }

    .strain-actions {
        flex-direction: column;
    }

    .match-strength {
        flex-direction: column;
        align-items: stretch;
    }
}

@media screen and (max-width: 768px) {

    #user-input {
        height: 100px; /* Fixed height on mobile */
        max-height: 100px;
        resize: none; /* Prevent manual resizing */
        position: fixed; /* Keep it in view */
        bottom: 60px; /* Space for buttons */
        left: 0;
        right: 0;
        width: 100%;
        z-index: 100;
        padding: 10px;
        background: white;
        font-size: 16px; /* Prevent iOS zoom on focus */
        margin-bottom: 8px;
        border-radius: 8px;
    }
    
    #buttons {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px;
        background: white;
        z-index: 100;
        display: flex;
        justify-content: space-around;
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        align-items: center;
    }
    
    #recommendations {
        margin-bottom: 170px; /* Space for fixed input and buttons */
    }

    .mobile-input-container {
        position: sticky;
        bottom: 0;
        background: var(--background-color);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        padding: 10px;
    }

    .btn--icon {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

}


/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
   @media (prefers-color-scheme: dark) {
    .checkbox-container,
    .recommendation-header,
    .effect-item {
        background: var(--bg-light);
    }

    .checkbox-container:hover {
        background: var(--bg-lighter);
    }
}


/* ==========================================================================
   Utility Classes
   ========================================================================== */
.hidden {
    display: none
}

.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    margin: -0.5em 0 0 -0.5em;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

#favorites-panel,
#feedback-panel {
    margin: 0;
}

.strain-favorite,
.strain-feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.strain-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Registration and Login Styles
    ========================================================================== */
/* Authentication Forms */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form h2 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 10px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(50, 168, 82, 0.2);
}

.auth-form .btn {
    background-color: var(--color-primary);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.auth-form .btn:hover {
    background-color: var(--color-primary-dark);
}

.auth-form .error-message {
    color: var(--color-danger);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-form .success-message {
    color: var(--color-success);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--color-primary);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.btn--green {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 4px;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.btn--green:hover {
    background-color: #45a049;
}

/* Tier-based UI Elements */
[data-user-tier] {
    --tier-color-demo: #6c757d;
    --tier-color-registered: #32a852;
    --tier-color-subscriber: #17a2b8;
    --tier-color-advanced: linear-gradient(45deg, #32a852, #17a2b8);
}

.user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9em;
    font-weight: 500;
    margin-left: var(--space-md);
}

[data-user-tier="demo"] .tier-badge.demo {
    background: var(--tier-color-demo);
    color: white;
}

[data-user-tier="registered"] .tier-badge.registered {
    background: var(--tier-color-registered);
    color: white;
}

[data-user-tier="subscriber"] .tier-badge.subscriber {
    background: var(--tier-color-subscriber);
    color: white;
}

[data-user-tier="advanced"] .tier-badge.advanced {
    background: var(--tier-color-advanced);
    color: white;
}

/* Panel visibility based on tier */
[data-tier-required] {
    transition: opacity var(--transition-medium), transform var(--transition-medium);
}

[data-tier-required].hidden {
    display: none;
}

/* Upgrade prompts */
.upgrade-prompt {
    background: var(--bg-lighter);
    border-radius: 8px;
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    text-align: center;
}

.upgrade-prompt .btn-upgrade {
    margin-top: var(--space-md);
    background: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: var(--transition-standard);
}

.upgrade-prompt .btn-upgrade:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* Feature Availability Indicators */
.feature-locked {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.feature-locked .fa-lock {
    margin-right: 8px;
    color: #ff6b6b;
}

.feature-locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
}

/* Tier-specific Content */
[data-tier-required]:not([data-tier-required=demo]) {
    display: none;
}

.user-tier-registered [data-tier-required=registered],
.user-tier-subscriber [data-tier-required=subscriber],
.user-tier-advanced [data-tier-required=advanced] {
    display: block;
}

/* Tier-based UI Elements */
.upgrade-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-white);
    padding: var(--space-xl);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.upgrade-modal h3 {
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.upgrade-modal p {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.feature-locked {
    position: relative;
    opacity: 0.7;
}

.feature-locked::before {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 1;
}

.feature-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: inherit;
}

.tier-indicator {
    display: inline-flex;
    background-color: var(--color-primary);
    color: white;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    margin-left: auto;
}

.tier-indicator i {
    font-size: 1.2em;
}

/* Tier-specific styling */
[data-tier="demo"] .tier-indicator {
    background: var(--bg-lighter);
    color: var(--text-muted);
}

[data-tier="registered"] .tier-indicator {
    background: var(--color-primary);
    color: white;
}

[data-tier="subscriber"] .tier-indicator {
    background: var(--color-info);
    color: white;
}

[data-tier="advanced"] .tier-indicator {
    background: linear-gradient(45deg, var(--color-primary), var(--color-info));
    color: white;
}

/* Tier-based Animations */
.upgrade-modal {
    animation: modalFadeIn 0.3s ease-out;
}

.feature-locked {
    animation: lockPulse 2s infinite;
}

.tier-indicator {
    animation: slideIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes lockPulse {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Interactive States */
.upgrade-modal:hover .btn-upgrade {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tier-indicator[data-tier]:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Keyframe Animations for Tier Features */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(50, 168, 82, 0.2); }
    50% { box-shadow: 0 0 15px rgba(50, 168, 82, 0.4); }
}

/* Animation Classes */
.shake {
    animation: shake 0.5s ease-in-out;
}

.bounce {
    animation: bounce 0.5s ease-in-out;
}

.glow {
    animation: glow 2s infinite;
}

/* Interactive Animation States */
.panel.feature-locked:hover {
    cursor: not-allowed;
    animation: shake 0.5s ease-in-out;
}

.tier-indicator:hover {
    animation: bounce 0.5s ease-in-out;
}

.btn-upgrade:hover {
    animation: glow 2s infinite;
}

.disclaimer {
    background-color: #ffebee;
    border: 2px solid #ef5350;
    color: #c62828;
    padding: 15px;
    margin: 20px 0 0 0;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9em;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    order: 999; /* This moves it to the bottom */
}


.fa-check {
    color: #4CAF50;
    margin-right: 10px;
}

.title-section {
    background: linear-gradient(135deg, #2c5e1e, #4a8c3a);
    background-image: url('../images/leaf-texture.png'), linear-gradient(135deg, #2c5e1e, #4a8c3a);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.title-section h1 {
    color: #ffffff;
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.demo-title-suffix {
    background: #ffd700;
    color: #2c5e1e;
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 1rem;
    text-shadow: none;
}

.demo-notice h2,
.demo-notice p
.demo-features h3,
.demo-features li,
.feature-comparison,
.demo-mode h2,
.demo mode p {
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.demo-notice {
    color: #ffffff;
}

.demo-notice * {
    color: inherit;
}

.feature-comparison {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.demo-features, .premium-features {
    padding: 15px;
    border-radius: 8px;
}

.demo-features h3, .premium-features h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.demo-features ul, .premium-features ul {
    list-style: none;
    padding-left: 10px;
}

.demo-features li, .premium-features li {
    padding: 5px 0;
    color: #34495e;
}

.premium-features li {
    color: #27ae60;
}

.footer {
    margin-top: auto;
    padding: 20px;
    background: var(--bg-lighter);
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}


.version {
    color: var(--text-muted);
    font-size: 0.9em;
    position: absolute;
    left: 0;
}

#report-issue {
    margin: 0 auto;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#report-issue:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.modal.hidden {
    display: none;
}

#issue-form .form-group {
    margin-bottom: 15px;
}

#issue-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 8px;
}

.tab-container {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background: var(--bg-light);
    border: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: var(--transition-standard);
}

.tab-button.active {
    background: var(--color-primary);
    color: white;
}

.tab-button.feature-locked {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
}

.tab-button.feature-locked:hover {
    background-color: #e9ecef;
}


.tab-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tab-content.hidden {
    display: none;
}

#strain-search {
    padding: 12px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    font-size: 1rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-medium);
    background: var(--bg-white);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-standard);
}

.pagination button:hover {
    background: var(--bg-lighter);
    transform: translateY(-1px);
}

.pagination button.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.user-badge-container {
    display: inline-flex;
    align-items: center;
    margin: 10px;
}

.user-badge {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

.badge-label {
    font-weight: 600;
    font-size: 14px;
}

.demo-badge {
    background: #E0E0E0;
    color: #757575;
}

.registered-badge {
    background: #81C784;
    color: white;
}

.paid-badge {
    background: #7B1FA2;
    color: white;
}

.subscriber-badge {
    background: #7B1FA2;
    color: white;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Add this after the existing .subscriber-badge definition */
.admin-badge {
    background: linear-gradient(135deg, #1a237e 0%, #311b92 100%);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #7c4dff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-badge::before {
    content: "⚡";
    font-size: 1rem;
}

.admin-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4444;
    color: white;
    padding: 15px 30px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
    font-weight: 500;
    text-align: center;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.success-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745;
    color: white;
    padding: 15px 30px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease-out forwards;
}

.section-header {
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-header i {
    color: var(--color-primary);
}

.intent-details, .characteristics-container, 
.medical-subsection, .concerns-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.goal-tag, .characteristic-tag, 
.medical-tag, .concern-tag {
    background: var(--bg-lighter);
    padding: 6px 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.goal-tag { background: #e3f2fd; color: #1565c0; }
.characteristic-tag { background: #e8f5e9; color: #2e7d32; }
.medical-tag { background: #f3e5f5; color: #7b1fa2; }
.concern-tag { background: #ffebee; color: #c62828; }

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.medical-subsection h4 {
    color: var(--text-primary);
    margin: var(--space-md) 0 var(--space-sm);
}
