body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tab Styles */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #666;
}

.tab.active {
    color: #2196F3;
    border-bottom: 2px solid #2196F3;
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.quick-select {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    background: white;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    transition: all 0.2s ease;
}

.quick-btn.measurement-btn {
    font-weight: bold;
    font-size: 1.1em;
    min-width: 70px;
    background: #e3f2fd;
    border: 2px solid #bbdefb;
    color: #1976D2;
}

.quick-btn.measurement-btn:hover {
    background: #bbdefb;
    border-color: #1976D2;
}

.quick-btn.selected {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* Health status buttons */
.health-btn {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
    margin: 5px;
    display: inline-block;
    transition: all 0.2s ease;
}

.health-btn.excellent {
    background-color: #4CAF50;
    color: white;
    border-color: #388E3C;
}

.health-btn.good {
    background-color: #8BC34A;
    color: white;
    border-color: #689F38;
}

.health-btn.fair {
    background-color: #FFC107;
    color: #333;
    border-color: #FFA000;
}

.health-btn.poor {
    background-color: #FF9800;
    color: white;
    border-color: #F57C00;
}

.health-btn.critical {
    background-color: #F44336;
    color: white;
    border-color: #D32F2F;
}

.health-btn.selected {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.health-status-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tree-selector {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
}

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

.current-tree {
    font-size: 18px;
    font-weight: bold;
}

.gps-coords {
    font-size: 14px;
    color: #666;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #45a049;
}

.scan-btn {
    background-color: #2196F3;
}

.scan-btn:hover {
    background-color: #0b7dda;
}

.qr-container {
    display: none;
    margin: 20px 0;
    text-align: center;
}

#qr-reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.qr-message {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #F44336;
}

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

.category-insights {
    margin-bottom: 30px;
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
}

.category-insights h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.category-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-table th,
.category-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.category-table th {
    background-color: #f1f1f1;
    font-weight: bold;
}

.category-table tr:hover {
    background-color: #f5f5f5;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
}

.history {
    margin-top: 30px;
}

.history h2 {
    margin-bottom: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f8f8;
}

.tree-list {
    margin-top: 20px;
}

.tree-item {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.tree-details {
    margin-top: 20px;
}

.tree-measurements {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.button-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.export-btn {
    background-color: #2196F3;
}

.export-btn:hover {
    background-color: #1976D2;
}

.tree-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.secondary-btn {
    background-color: #607D8B;
}

.secondary-btn:hover {
    background-color: #455A64;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .tree-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tree-actions {
        margin-top: 10px;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}
