/* Field Tool CSS - Industrial/Utility Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c5530;
    --primary-dark: #1e3a21;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    color: var(--gray-800);
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header - Field Tool Style */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem;
    border-bottom: 3px solid var(--warning-color);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

h1 i {
    color: var(--warning-color);
    margin-right: 0.5rem;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.field-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    font-size: 0.85rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem;
    border-radius: 4px;
}

.info-item .label {
    font-weight: 500;
    opacity: 0.8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    font-weight: 600;
    margin-top: 0.25rem;
}

.status-online {
    color: var(--success-color) !important;
}

/* Main Content */
main {
    padding: 1rem;
}

.inspection-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.panel-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.panel-header h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
    font-weight: 600;
}

.inspection-number {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.inspection-number .label {
    font-weight: 500;
}

.inspection-number .value {
    font-weight: 600;
    color: var(--primary-color);
    margin-left: 0.5rem;
}

/* Capture Zone */
.capture-section {
    padding: 1rem;
}

.capture-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-50);
}

.capture-zone:hover,
.capture-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(44, 85, 48, 0.05);
}

.capture-content i {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.capture-content h3 {
    font-size: 1.1rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.capture-content p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Analysis Section */
.analysis-section {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
}

.image-preview {
    flex: 1;
    position: relative;
}

.image-preview img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--gray-200);
}

.clear-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Field Controls */
.controls {
    flex: 1;
    min-width: 250px;
}

.field-settings {
    margin-bottom: 1.5rem;
}

.setting-row {
    margin-bottom: 1rem;
}

.setting-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.setting-row input[type="range"] {
    width: 100%;
    margin-bottom: 0.25rem;
}

.setting-row small {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-style: italic;
}

.location-info {
    margin-top: 1rem;
}

.location-info label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.location-info input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
}

.analyze-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
    transition: all 0.2s ease;
}

.analyze-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.analyze-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

/* Inspection Report */
.results {
    margin-top: 1rem;
    padding: 1rem;
}

.inspection-report {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: white;
}

.report-header {
    background: var(--gray-50);
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.report-header h3 {
    font-size: 1.1rem;
    color: var(--gray-800);
    font-weight: 600;
}

.timestamp {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.finding-card {
    padding: 1.5rem;
}

.finding-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-badge {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.normal {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.status-badge.damaged {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

.status-badge.uncertain {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 2px solid var(--warning-color);
}

.confidence-meter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.confidence-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
}

.confidence-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.5s ease;
}

.confidence-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

.finding-details {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.finding-details p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.finding-details p:last-child {
    margin-bottom: 0;
}

.finding-details strong {
    color: var(--gray-800);
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    transition: all 0.2s ease;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-dark);
}

.action-btn.secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.action-btn.secondary:hover {
    background: var(--gray-300);
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
}

.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
}

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

.processing-indicator p {
    font-weight: 600;
    color: var(--gray-700);
}

.processing-indicator small {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* Error */
.error {
    padding: 1rem;
    margin: 1rem 0;
}

.error-content {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger-color);
    text-align: center;
}

.error-content i {
    font-size: 1.5rem;
}

.error-content small {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Field Guide */
.field-guide {
    margin-top: 2rem;
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1.5rem;
}

.guide-section h3 {
    color: var(--gray-800);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

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

.guide-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.guide-item ul {
    list-style: none;
}

.guide-item li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    position: relative;
    padding-left: 1.5rem;
}

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

.guide-item li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Footer */
footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 1rem;
    margin-top: 2rem;
}

.system-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--gray-600);
    flex-wrap: wrap;
    gap: 1rem;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.25rem;
}

.status-indicator.online {
    background: var(--success-color);
    box-shadow: 0 0 4px var(--success-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .field-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .analysis-section {
        flex-direction: column;
    }
    
    .finding-status {
        flex-direction: column;
        align-items: stretch;
    }
    
    .confidence-meter {
        min-width: auto;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
    
    .system-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}