
/* Photo Uploader */
.photo-uploader {
    margin: 10px 0;
}

.photo-preview {
    position: relative;
    display: inline-block;
}

.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-preview button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 12px;
}

.upload-status {
    margin-top: 8px;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
}

.upload-status.info {
    background: #e3f2fd;
    color: #1976d2;
}

.upload-status.success {
    background: #e8f5e9;
    color: #388e3c;
}

.upload-status.error {
    background: #ffebee;
    color: #d32f2f;
}

/* Crop Planning Styles */
.crop-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.crop-plan-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.crop-plan-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.crop-plan-item h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.plan-year {
    color: #5a6268;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.plan-notes {
    color: #333;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.view-plan-btn {
    margin-top: 1rem;
}

.plan-detail {
    max-width: 1200px;
}

.plan-header {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.plan-header h2 {
    margin: 0 0 0.5rem 0;
}

.workload-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.workload-summary h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.total-hours {
    font-size: 1.5rem;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 1rem;
}

.workload-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.workload-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
}

.workload-item .category {
    font-weight: 500;
}

.workload-item .hours {
    color: #5a6268;
}

.planned-crops-section {
    margin-top: 2rem;
}

.planned-crops-section h3 {
    margin: 0 0 1rem 0;
}

.crops-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
}

.crops-table th,
.crops-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.crops-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.crops-table tr.planned-crop-item:hover {
    background: #f8f9fa;
}

.crops-table tr.has-warning {
    background: #fff3cd;
}

.crops-table tr.rotation-warning td {
    background: #fff3cd;
    color: #856404;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-top: none;
}

.empty-state {
    text-align: center;
    color: #5a6268;
    padding: 2rem;
    font-style: italic;
}

.help-text {
    color: #5a6268;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.back-btn {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .crops-table {
        font-size: 0.85rem;
    }
    
    .crops-table th,
    .crops-table td {
        padding: 0.5rem;
    }
    
    .workload-breakdown {
        grid-template-columns: 1fr;
    }
}

/* Seed Inventory Styles */
.seeds-summary {
    margin: 1.5rem 0;
}

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

.stat-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card.warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.stat-label {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.seed-row.status-expired {
    background: #ffe6e6;
}

.seed-row.status-depleted {
    background: #f0f0f0;
    opacity: 0.7;
}

.seed-row.status-warning {
    background: #fff9e6;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-available {
    background: #d4edda;
    color: #155724;
}

.badge-planted {
    background: #cce5ff;
    color: #004085;
}

.badge-expired {
    background: #f8d7da;
    color: #721c24;
}

.badge-depleted {
    background: #e2e3e5;
    color: #383d41;
}

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

.detail-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.detail-section h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.detail-section p {
    margin: 0.5rem 0;
}

/* Invoicing Styles */
.invoices-summary {
    margin: 1.5rem 0;
}

.stat-card.danger {
    background: #f8d7da;
    border-color: #dc3545;
}

.invoice-row.status-paid {
    background: #d4edda;
}

.invoice-row.status-overdue {
    background: #f8d7da;
}

.badge-draft {
    background: #e7e7e7;
    color: #333;
}

.badge-sent {
    background: #cce5ff;
    color: #004085;
}

.badge-paid {
    background: #d4edda;
    color: #155724;
}

.badge-overdue {
    background: #f8d7da;
    color: #721c24;
}

.badge-cancelled {
    background: #6c757d;
    color: white;
}

.invoice-details {
    margin: 1rem 0;
}

.invoice-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.line-item {
    margin-bottom: 0.5rem;
}

.data-table tfoot {
    font-weight: 500;
}

.data-table .total-row {
    background: #f8f9fa;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .invoice-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Calendar Styles */
#calendar-container {
    max-width: 900px;
    margin: 2rem auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.calendar-summary {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #e9ecef;
    border-radius: 8px;
}

.calendar-grid {
    margin-bottom: 2rem;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
}

.weekday {
    background: #6c757d;
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.day-cell {
    min-height: 80px;
    background: white;
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    position: relative;
}

.day-cell.empty {
    background: #f8f9fa;
}

.day-cell.today {
    background: #fff9e6;
    border-color: #ffc107;
}

.day-cell.has-events {
    background: #e7f3ff;
}

.day-number {
    font-weight: 600;
    color: #495057;
}

.day-events {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0.5rem;
}

.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.event-dot.event-planting {
    background: #28a745;
}

.event-dot.event-harvest {
    background: #ffc107;
}

.event-dot.event-task {
    background: #007bff;
}

.calendar-list {
    margin-top: 2rem;
}

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

.event-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 4px;
}

.event-item.event-planting {
    border-left-color: #28a745;
}

.event-item.event-harvest {
    border-left-color: #ffc107;
}

.event-date {
    font-weight: 600;
    min-width: 80px;
}

.event-title {
    flex: 1;
}

.event-quantity, .event-area {
    font-size: 0.9rem;
    color: #495057;
}

@media (max-width: 768px) {
    .days-grid {
        gap: 1px;
    }
    
    .day-cell {
        min-height: 60px;
        padding: 0.25rem;
        font-size: 0.85rem;
    }
    
    .calendar-summary {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Improved Navigation System */
.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-primary {
    display: flex;
    gap: 0.5rem;
}

.nav-primary .tab-btn {
    background: white;
    color: #667eea;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.nav-primary .tab-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.nav-primary .tab-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-categories {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0.5rem;
    min-width: 220px;
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease;
}

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

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu .tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    color: #333;
    font-size: 0.95rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 0.25rem;
}

.dropdown-menu .tab-btn:hover {
    background: #f0f0f0;
    color: #667eea;
    transform: translateX(5px);
}

.dropdown-menu .tab-btn.active {
    background: #667eea;
    color: white;
}

/* Mobile responsive */
@media (max-width: 968px) {
    .main-nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-primary {
        justify-content: center;
    }
    
    .nav-categories {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.95);
        margin-top: 0.5rem;
    }
    
    .nav-dropdown.mobile-open .dropdown-menu {
        display: block;
    }
}

/* Unified Page Container Styles */
/* All pages use consistent .page-{name} convention */

/* Pages that previously had mt-5 need top margin */
.page-admin,
.page-community,
.page-public-unit,
.page-resources {
    margin-top: 3rem;
}

/* Standard section padding for all pages */
.page-admin > .section,
.page-community > .section,
.page-cultivation > .section,
.page-equipment-calendar > .section,
.page-harvests > .section,
.page-invoicing > .section,
.page-notes > .section,
.page-plantings > .section,
.page-plants-library > .section,
.page-preservation > .section,
.page-public-unit > .section,
.page-resources > .section,
.page-seeds > .section,
.page-weather > .section {
    padding-top: 1rem;
}


/* Harvest Display Redesign - Year > Plant > Sessions */
.harvest-list {
    margin-top: 1.5rem;
}

.harvest-year-group {
    margin-bottom: 2rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.year-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

.year-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.year-summary {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.summary-item {
    white-space: nowrap;
}

.collapse-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.harvest-year-group.collapsed .year-header .collapse-icon {
    transform: rotate(-90deg);
}

.harvest-year-group.collapsed .plants-section {
    display: none;
}

.plants-section {
    background: #f8f9fa;
    padding: 1rem;
}

.plant-group {
    background: white;
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.plant-group:last-child {
    margin-bottom: 0;
}

.plant-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plant-header:hover {
    background: linear-gradient(135deg, #0e8a7e 0%, #2ed96e 100%);
}

.plant-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plant-summary {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.plant-group.collapsed .plant-header .collapse-icon {
    transform: rotate(0deg);
}

.plant-group:not(.collapsed) .plant-header .collapse-icon {
    transform: rotate(90deg);
}

.plant-group.collapsed .harvest-sessions {
    display: none;
}

.harvest-sessions {
    padding: 0.5rem;
}

.harvest-session {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.harvest-session:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.harvest-session:last-child {
    margin-bottom: 0;
}

.session-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.session-date {
    font-weight: 500;
    color: #495057;
    min-width: 100px;
}

.session-quantity {
    color: #28a745;
    min-width: 80px;
}

.session-quality {
    color: #6c757d;
    flex: 1;
}

.session-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.harvest-details {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.harvest-session.expanded .harvest-details {
    display: block;
}

.harvest-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #495057;
}

.harvest-details strong {
    color: #212529;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .year-summary,
    .plant-summary {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .session-summary {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .session-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}
