* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #2980c9 100%);
    color: white;
    border-radius: 10px;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.section h2 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

input[type="text"], input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

.earth-inputs {
    display: none;
    margin-top: 15px;
}

.earth-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.earth-input-group input {
    width: 120px;
}

.failure-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.failure-item h4 {
    color: #dc3545;
    margin-bottom: 10px;
}

.image-upload {
    border: 2px dashed #dee2e6;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.image-upload:hover {
    border-color: #007bff;
}

.result-display {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
}

.result-display h4 {
    color: #0c5460;
    margin-bottom: 10px;
}

.standards-dropdown {
    margin-bottom: 20px;
}

.failures-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: white;
}

.failure-option {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}

.failure-option:hover {
    background-color: #f8f9fa;
}

.failure-option.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

#generateReport {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    margin-top: 30px;
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
}

.hidden {
    display: none;
}

.collapsible-container {
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
}

.collapsible-header {
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #495057;
    transition: background-color 0.3s;
}

.collapsible-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.collapsible-content {
    display: none;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
}

.collapsible-content.active {
    display: block;
}

.reference-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.4;
}

.reference-list ul {
    padding-left: 20px;
}

.reference-list li {
    margin-bottom: 5px;
}

/* Hidden file input styling */
.hidden-file-input {
    display: none;
}

/* Failure reference styling */
.failure-reference {
    font-size: 12px;
    color: #6c757d;
    margin: 5px 0;
    font-style: italic;
}

/* Minimum requirement styling */
.minimum-requirement {
    font-size: 11px;
    color: #28a745;
    margin: 8px 0;
    font-weight: bold;
    background-color: #f8fff9;
    padding: 8px;
    border-left: 3px solid #28a745;
    border-radius: 3px;
}

/* Other field input styling */
.other-field-input {
    margin-top: 5px;
}

@media print {
    .container {
        box-shadow: none;
        max-width: none;
        margin: 0;
        padding: 10px;
    }
    
    button {
        display: none;
    }
    
    .reference-section {
        display: none;
    }

    .new-report-button {
    background-color: #e74c3c;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    }

    .new-report-button:hover {
    background-color: #c0392b;
    }
    .nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #ecf0f1;
}

.nav-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: #2980b9;
}

.back-button {
    background-color: #95a5a6;
}

.back-button:hover {
    background-color: #7f8c8d;
}

.page-title {
    font-size: 28px;
    color: #2c3e50;
    margin: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .nav-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .page-title {
        font-size: 24px;
    }

    /* Enhanced Earth Table Styles */
.earth-table-container {
    margin: 20px 0;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.earth-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.earth-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    border: none;
}

.earth-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

.earth-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.earth-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Earth number column styling */
.earth-table .earth-number {
    font-weight: bold;
    background-color: #e3f2fd;
    color: #1976d2;
    width: 40px;
}

/* Input and select styling within table */
.earth-table input[type="number"] {
    width: 80px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

.earth-table select {
    width: 100%;
    min-width: 80px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
}

.earth-table input[type="text"] {
    width: 100%;
    min-width: 80px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
}

/* Overall resistance styling */
.overall-resistance-value {
    font-size: 24px;
    font-weight: bold;
    color: #2980b9;
    text-align: center;
    margin: 10px 0;
    padding: 15px;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
    border-radius: 8px;
    border: 2px solid #2980b9;
}

/* Validation error styling */
.earth-table .error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.earth-table .error-message {
    color: #dc3545;
    font-size: 11px;
    margin-top: 2px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .earth-table {
        font-size: 12px;
    }
    
    .earth-table th,
    .earth-table td {
        padding: 6px 4px;
    }
    
    .earth-table input,
    .earth-table select {
        font-size: 11px;
        padding: 2px;
    }
    
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .earth-table th,
    .earth-table td {
        padding: 4px 2px;
        font-size: 11px;
    }
    
    .earth-table input[type="number"] {
        width: 60px;
    }
    
    .earth-table select,
    .earth-table input[type="text"] {
        min-width: 60px;
    }
}


.add-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.add-btn:hover {
    background-color: #229954;
}

/* Signature styles (if not already present) */
.signature-container {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    background: #f8f9fa;
    max-width: 320px;
}

#siteStaffSignatureCanvas {
    border: 2px solid #007bff;
    border-radius: 5px;
    background: white;
    cursor: crosshair;
    width: 100%;
    max-width: 300px;
    height: 120px;
    display: block;
    margin: 0 auto;
    touch-action: none;
}

.signature-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.signature-btn {
    padding: 6px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.clear-btn {
    background-color: #6c757d;
    color: white;
}

.clear-btn:hover {
    background-color: #5a6268;
}

.save-btn {
    background-color: #28a745;
    color: white;
}

.save-btn:hover {
    background-color: #218838;
}

.signature-status {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
}

