/* Card Component */
.card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background-color 0.3s;
}

/* Plant Cards */
.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.plant-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.plant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.plant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.plant-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
}

.plant-details {
    color: var(--text-secondary);
    font-size: 14px;
}

/* QR Section */
.qr-section {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.qr-display {
    text-align: center;
}

.qr-display img {
    max-width: 150px;
    margin: 10px auto;
    display: block;
    background: white;
    padding: 10px;
    border-radius: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state button {
    margin-top: 20px;
}

/* Buttons */
button.primary {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

button.primary:hover {
    background-color: var(--accent-hover);
}

button.secondary {
    background-color: #757575;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

button.secondary:hover {
    background-color: #616161;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Error State */
.error {
    color: #d32f2f;
    padding: 20px;
    text-align: center;
    background-color: #ffebee;
    border-radius: 4px;
    margin: 10px 0;
}

/* Collapsible sections */
.collapsible {
    background: #f5f5f5;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible:hover {
    background: #eeeeee;
}

.collapsible-content {
    display: none;
    padding: 15px;
    background: #fafafa;
    border-radius: 4px;
    margin-top: 5px;
}

.collapsible-content.show {
    display: block;
}

/* File upload */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 10px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    background: #eeeeee;
    border-color: #2e7d32;
}

.photo-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.photo-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* AI Fill button */
.ai-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
}

.ai-fill:hover {
    opacity: 0.9;
}

/* Weather Widget */
.weather-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

[data-theme="dark"] .weather-widget {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.weather-current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.weather-temp {
    font-size: 48px;
    font-weight: bold;
}

.weather-forecast {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.forecast-day {
    text-align: center;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Weather Calendar */
.weather-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    position: relative;
}

.calendar-day.hot {
    background: #ffcdd2;
}

.calendar-day.warm {
    background: #fff9c4;
}

.calendar-day.nice {
    background: #c8e6c9;
}

[data-theme="dark"] .calendar-day.hot {
    background: #d32f2f;
    color: white;
}

[data-theme="dark"] .calendar-day.warm {
    background: #f57c00;
    color: white;
}

[data-theme="dark"] .calendar-day.nice {
    background: #388e3c;
    color: white;
}

.calendar-day.rain {
    border: 2px solid #1976d2;
}

/* Collapsible Sections */
.collapsible {
    background: var(--bg-primary);
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.collapsible:hover {
    background: var(--input-bg);
}

.collapsible-content {
    display: none;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 4px;
    margin-top: 5px;
}

.collapsible-content.show {
    display: block;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.quick-actions button {
    flex: 1;
    min-width: 150px;
}

/* Garden Selector */
.garden-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.garden-selector select {
    flex: 1;
}

/* Photo Preview */
.photo-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.photo-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--border-color);
}

/* Settings */
.settings-btn {
    background: none;
    border: none;
    color: var(--header-text);
    cursor: pointer;
    font-size: 24px;
}

.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.settings-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
}

/* Map */
#map {
    height: 400px;
    border-radius: 8px;
    margin-top: 20px;
    filter: var(--map-filter, none);
}

[data-theme="dark"] #map {
    --map-filter: invert(100%) hue-rotate(180deg);
}

/* Variety Display */
.variety-display {
    font-weight: 600;
    color: var(--accent-color);
}

/* Responsive Components */
@media (max-width: 768px) {
    .weather-forecast {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Activity Timeline */
.activity-timeline {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.activity-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 5px;
}

.activity-plant {
    font-weight: 500;
    color: var(--accent-color);
    cursor: pointer;
}

.activity-plant:hover {
    text-decoration: underline;
}

.activity-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.activity-description {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.activity-notes {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

#activity-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Watering Modal Styles */
.watering-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.watering-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.watering-item.due {
    border-color: #ff9800;
}

.watering-item.overdue {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.watering-item.watered {
    opacity: 0.5;
    border-color: var(--accent-color);
}

.watering-plant-info {
    flex: 1;
}

.watering-status {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.water-button {
    flex-shrink: 0;
}

.watering-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.watering-settings h3 {
    margin-bottom: 15px;
}

/* Plant Health Indicator */
.plant-health-indicator {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 20px;
}

.health-score {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.score-number {
    font-size: 28px;
    font-weight: bold;
}

.score-label {
    font-size: 12px;
    text-transform: uppercase;
}

.health-details {
    flex: 1;
}

.health-status {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.health-recommendations {
    font-size: 14px;
    color: var(--text-secondary);
}

.health-recommendations > div {
    margin-top: 5px;
}

/* Harvest Dashboard */
.harvest-dashboard {
    padding: 20px;
}

.harvest-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.harvest-totals {
    margin-bottom: 30px;
}

.harvest-total-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.harvest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 4px;
    margin-bottom: 8px;
}

.harvest-date {
    font-size: 14px;
    color: var(--text-secondary);
}

/* AI Variety Details */
.ai-variety-details {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid var(--accent-color);
}

.ai-header {
    text-align: center;
    margin-bottom: 20px;
}

.ai-header h3 {
    margin: 0 0 5px 0;
    color: var(--accent-color);
}

.ai-header small {
    color: var(--text-secondary);
}

.detail-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.special-requirement {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

[data-theme="dark"] .special-requirement {
    background: #664d03;
    color: #ffda6a;
}

.special-instructions {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

[data-theme="dark"] .special-instructions {
    background: #0c5460;
    color: #bee5eb;
}

.arizona-specific {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

[data-theme="dark"] .arizona-specific {
    background: #5a2028;
    border: 1px solid #842029;
}

.issue-item {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.issue-symptoms {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 5px 0;
}

.issue-solution {
    font-size: 14px;
    color: var(--accent-color);
    font-weight: 500;
}

.harvest-indicators ul {
    margin: 10px 0 0 20px;
}

/* Loading state for AI */
.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.ai-loading::before {
    content: '🤖';
    font-size: 32px;
    margin-right: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Variety Items with AI */
.variety-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.variety-info {
    flex: 1;
}

.ai-details-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.ai-details-btn:hover {
    background: #357abd;
}

/* AI Modal */
#ai-details-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

#ai-inline-details {
    margin: 20px 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* QR Preview */
#qr-preview img {
    max-width: 150px;
    height: auto;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: white;
}

/* Date Group */
.date-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

/* Photo Preview */
#photo-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Form Elements Dark Mode */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--input-focus);
}

/* Details/Summary Dark Mode */
[data-theme="dark"] details {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] summary {
    color: var(--text-primary);
}

/* Radio and Checkbox Dark Mode */
[data-theme="dark"] input[type="radio"],
[data-theme="dark"] input[type="checkbox"] {
    border-color: var(--input-border);
}

/* Plant Detail Styles */
.plant-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.plant-actions {
    display: flex;
    gap: 0.5rem;
}

.plant-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.detail-section {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
}

.detail-section h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.detail-section p {
    margin: 0.25rem 0;
    color: #4b5563;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-harvested {
    background: #ddd6fe;
    color: #4c1d95;
}

.status-removed,
.status-dead {
    background: #fee2e2;
    color: #991b1b;
}

.event-list {
    max-height: 400px;
    overflow-y: auto;
}

.event-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.event-item:last-child {
    border-bottom: none;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.event-type {
    font-weight: 500;
    color: #1f2937;
}

.event-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.event-notes {
    color: #4b5563;
    margin: 0.5rem 0;
}

.event-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-item img:hover {
    transform: scale(1.05);
}

.photo-caption {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    color: #4b5563;
}

.photo-date {
    font-size: 0.75rem;
    color: #9ca3af;
}
