/* Feature Styles */

/* Symptom Tags */
.symptom-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--background);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.symptom-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-text);
}

.symptom-tag input {
    display: none;
}

/* Record Items */
.record-item {
    background: var(--background);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.record-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Fixed colours (not CSS vars) so these read the same in light and dark
   mode - a plain outline button loses too much contrast in dark mode
   otherwise. */
.record-action-btn {
    background: #2d5a3d;
    border: 1px solid #2d5a3d;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1.4;
    min-width: 44px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.record-action-btn--delete {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.record-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.record-item-title {
    font-weight: 600;
}

.record-item-date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.record-item-desc {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Milestone Items */
.milestone-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 8px;
}

.milestone-item.completed {
    background: rgba(45,90,61,0.12);
}

.milestone-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.milestone-item.completed .milestone-check {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Sex Toggle */
.sex-toggle {
    display: flex;
    gap: 8px;
}

.sex-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Breed Dropdown with Groups */
.breed-select optgroup {
    font-weight: 600;
    color: var(--primary-text);
}

/* Breed Search Autocomplete */
.breed-search-container {
    position: relative;
}

.breed-search-input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.breed-search-input:focus {
    outline: none;
    border-color: var(--primary-text);
}

.breed-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
}

.breed-search-clear.show {
    display: block;
}

.breed-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 2px solid #E8891A;
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.breed-dropdown.show {
    display: block;
}

.breed-group-label {
    padding: 8px 16px;
    background: var(--background);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

.breed-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s;
}

.breed-option:hover, .breed-option:focus-visible, .breed-option.highlighted {
    background: var(--background);
}

.breed-option-name {
    font-weight: 500;
    pointer-events: none;
}

.breed-option-size {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--border);
    padding: 2px 8px;
    border-radius: 10px;
    pointer-events: none;
}

.breed-option .api-tag {
    pointer-events: none;
}

.breed-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

.breed-searching {
    padding: 12px 16px;
    text-align: center;
    color: var(--primary-text);
    font-size: 0.95rem;
    border-top: 1px solid var(--border);
}

.api-tag {
    font-size: 0.8rem;
    color: var(--primary-text);
    opacity: 0.7;
}

/* Dog Slot Options */
.dog-slot-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.dog-slot-option:hover, .dog-slot-option:focus-visible {
    border-color: var(--primary-text);
}

.dog-slot-option.purchased {
    background: rgba(45,90,61,0.12);
    border-color: var(--success);
    cursor: default;
}

.dog-slot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dog-slot-icon {
    font-size: 1.5rem;
}

.dog-slot-title {
    font-weight: 600;
}

.dog-slot-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dog-slot-price {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-text);
}

.dog-slot-purchased {
    color: var(--success);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Dog Selector Modal */
.dog-selector-list {
    display: grid;
    gap: 12px;
}

.dog-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card);
    border-radius: var(--radius);
    cursor: pointer;
    border: 5px solid var(--border);
    transition: border-color 0.2s;
}

.dog-selector-item:hover, .dog-selector-item:focus-visible {
    border-color: var(--primary-text);
}

.dog-selector-item.active {
    border-color: var(--primary-text);
}

.dog-selector-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    overflow: hidden;
}

.dog-selector-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dog-selector-info h4 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    margin-bottom: 2px;
}

.dog-selector-info p {
    font-size: 0.9rem;
    color: var(--text);
}

/* Age Dropdowns */
.age-dropdowns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.age-dropdown-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.age-select {
    width: 100%;
    padding: 10px 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.age-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

/* Calculator form sections */
.calc-section {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
}

.calc-section .form-label {
    margin-bottom: 8px;
}

.calc-section .form-group {
    margin-bottom: 0;
}

.calc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.calc-row .form-group {
    margin-bottom: 0;
}

.calc-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

/* Modal Dog Selector */
.modal-dog-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card);
    border: 5px solid var(--primary-text);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.modal-dog-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-dog-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-dog-info {
    flex: 1;
    min-width: 0;
}

.modal-dog-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.modal-dog-details {
    font-size: 0.9rem;
    color: var(--text);
}

.modal-dog-change {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.modal-dog-change:hover, .modal-dog-change:focus-visible,
.modal-dog-edit:hover, .modal-dog-edit:focus-visible {
    background: var(--primary-dark);
}

.modal-dog-edit {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
}

/* My Dogs Card with Dog Info */
.card-dog-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    overflow: hidden;
    margin-bottom: 8px;
}

.card-dog-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Version Footer */
.version-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    color: var(--text);
}

/* Feature sub-page chrome (ticket 1091 Phase A2). Moved here from an inline
   <style> block in functions/_shared.js's renderAppPage() so the native
   single-shell hash router (app/index.html, which already links this file)
   can style feature-page content too - it never had this CSS before since
   it was only ever inlined into the web feature-page template. */
.feature-page-back { display:inline-flex;align-items:center;gap:6px;padding:8px 16px;background:var(--card);border:1.5px solid var(--border);border-radius:8px;color:var(--text);font-size:0.95rem;font-weight:600;margin-bottom:16px;text-decoration:none;cursor:pointer; }
.feature-page-back:hover, .feature-page-back:focus { border-color:var(--primary-text);color:var(--primary-text); }
.feature-page-wrapper { width:100%;max-width:700px;margin:0 auto; }
.feature-body-preview { pointer-events:none; user-select:none; }
.feature-body-preview > * { opacity:0.35; }
#featureBody { background:var(--card);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);border:1px solid var(--border); }
.feature-page-heading { display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:12px; }
.feature-page-heading-icon { font-size:1.4rem;line-height:1; }
.feature-page-heading-title { font-size:1.2rem;font-weight:700;color:var(--text);margin:0; }
#featureBody .result-box { margin-top:0; }
#featureGate { margin-bottom:16px; }
