/* Tea Vendors and Collection Consolidated Styles */

/* ============================================
   COLLECTION CONTROLS
   ============================================ */
.collection-controls {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.filter-select,
.sort-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.filter-select:focus,
.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================
   COLLECTION ACTIONS
   ============================================ */
.collection-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

/* ============================================
   VENDOR GRID LAYOUT
   ============================================ */
.vendors-grid,
.shops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.vendor-card,
.shop-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vendor-card:hover,
.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

/* ============================================
   VENDOR CARD HEADER
   ============================================ */
.vendor-header,
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.vendor-header h3,
.shop-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.vendor-menu-btn,
.shop-menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
}

/* ============================================
   VENDOR CARD CONTENT
   ============================================ */
.vendor-location,
.shop-location {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.vendor-website {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.vendor-website:hover {
    text-decoration: underline;
}

.vendor-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.specialty-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.875rem;
}

.vendor-stats,
.shop-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.shop-rating {
    margin: 0.5rem 0;
    font-size: 1.125rem;
}

.shop-notes {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.75rem 0;
}

/* ============================================
   TEA COLLECTION GRID
   ============================================ */
.tea-collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tea-collection-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   TEA CARD STYLES
   ============================================ */
.tea-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tea-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

.tea-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.tea-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.favorite-badge {
    color: #fbbf24;
    font-size: 1.25rem;
}

.tea-type {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.tea-vendor {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.tea-rating {
    margin: 0.5rem 0;
}

.tea-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-small:hover {
    background: var(--bg-primary);
}

/* ============================================
   COLLECTION HEADER
   ============================================ */
.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    text-align: center;
    padding: 20px;
}

.collection-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.add-tea-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4a7c59, #5d8a60);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.add-tea-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(74 124 89 / 30%);
}

/* ============================================
   TEA TYPE GROUPING
   ============================================ */
.tea-type-group {
    margin-bottom: 2rem;
}

.tea-type-group h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tea-list {
    display: grid;
    gap: 0.5rem;
}

.tea-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.tea-item:hover {
    background-color: var(--bg-tertiary);
}

.tea-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tea-name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state p:first-child {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-previous-teas {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-previous-teas-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 50%);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 10%);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* ============================================
   INSIGHTS AND ANALYTICS
   ============================================ */
.insights-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.insights-container h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.insight-card {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgb(74 124 89 / 10%);
    text-align: center;
    transition: transform 0.2s ease;
}

.insight-card:hover {
    transform: translateY(-2px);
}

.insight-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.insight-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4a7c59;
    margin-bottom: 4px;
    display: block;
}

.insight-label {
    font-size: 0.9rem;
    color: #666;
    display: block;
}

.brewing-suggestion {
    background: linear-gradient(135deg, rgb(74 124 89 / 5%), rgb(74 124 89 / 10%));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid rgb(74 124 89 / 10%);
}

.suggestion-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a7c59;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-content {
    line-height: 1.6;
    color: #333;
}

/* ============================================
   CALENDAR STYLES
   ============================================ */
.calendar-container {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgb(74 124 89 / 10%);
}

.calendar-container h3 {
    margin-top: 0;
    color: var(--text-primary);
}

.tea-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover:not(.empty) {
    background-color: #e8f5e9;
}

.calendar-day.logged {
    background: linear-gradient(135deg, #4a7c59, #5d8a60);
    color: white;
    font-weight: 500;
}

.calendar-day.today {
    border: 2px solid #4a7c59;
}

.calendar-day.empty {
    background-color: transparent;
    cursor: default;
}

/* ============================================
   SUGGESTIONS AND LABELS
   ============================================ */
.suggestions-label {
    width: 100%;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a7c59;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    grid-column: 1/-1;
}

.suggestion-card {
    background: linear-gradient(135deg, #f8fdf9 0%, #e8f5e9 100%);
    border: 1px solid #4a7c59;
}

.suggestion-card:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #d4e8d6 100%);
}

.suggestion-tag {
    background: #4a7c59;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet Responsive */
@media (min-width: 960px) {
    .insights-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Halftop Resolution */
@media (min-width: 769px) and (max-width: 1024px) {
    .vendors-grid,
    .shops-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .collection-controls {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .vendors-grid,
    .shops-grid,
    .tea-collection {
        grid-template-columns: 1fr;
    }
    
    .vendor-stats,
    .shop-stats {
        font-size: 0.8125rem;
    }
    
    .collection-header {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .collection-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .collection-header p {
        font-size: 0.875rem;
        color: var(--text-secondary);
    }
    
    #tea-collection {
        padding: 0 1rem 1.5rem;
    }
    
    .tea-type-group h3 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
        padding-left: 0.5rem;
    }
    
    .tea-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tea-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem;
        background: var(--bg-secondary);
        border-radius: 8px;
    }
    
    .tea-name {
        font-size: 0.875rem;
        font-weight: 500;
    }
    
    .tea-count {
        font-size: 0.75rem;
        color: var(--text-secondary);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .collection-header {
        padding: 1.5rem 1rem;
    }
    
    .collection-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .collection-actions {
        display: flex;
        justify-content: center;
        padding: 1rem;
    }
    
    .tea-collection {
        max-width: 600px;
        margin: 0 auto;
        padding: 1rem;
    }
    
    .insight-card {
        padding: 15px;
    }
    
    .insight-icon {
        font-size: 2rem;
    }
    
    .insight-value {
        font-size: 1.5rem;
    }
}

/* Theme Adjustments */
.real-mode .insight-card {
    background-color: var(--bg-secondary);
}

.real-mode .tea-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.real-mode .vendor-card,
.real-mode .shop-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.real-mode .calendar-container {
    background-color: var(--bg-secondary);
}

.real-mode .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Accessibility */
button:focus,
.add-tea-btn:focus,
.btn-small:focus,
input:focus,
select:focus {
    outline: 3px solid var(--primary-color, #4A7C59);
    outline-offset: 2px;
}

/* Smooth Transitions and Touch Targets */
* {
    transition-duration: 0.2s;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent Text Selection on Interactive Elements */
button,
.vendor-card,
.shop-card,
.tea-card,
.calendar-day {
    user-select: none;
}