body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #336;
}

header {
    background-color: #336;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

main {
    padding: 1rem;
    text-align: center;
}

footer {
    text-align: center;
    padding: 1rem 0;
    background-color: #336;
    color: #fff;
    position: fixed;
    bottom: 0;
    width: 100%;
}

a {
    color: #336;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: #f0f0f0;
}

.button {
    display: inline-block;
    background: #336;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
}

.button:hover {
    background: #555;
}

nav ul {
    padding: 0;
    list-style: none;
    text-align: center;
}

nav ul li {
    display: inline;
    margin-right: 20px;
}

nav ul li a {
    text-decoration: none;
    color: red;
}

/* Form Styles */
.add-form {
    background-color: #fff;
    padding: 20px;
    margin-top: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    text-align: left;
}

.add-form h3 {
    margin-top: 0;
    text-align: center;
}

.add-form label {
    display: block;
    margin-bottom: 5px;
}

.add-form input[type="text"],
.add-form input[type="date"],
.add-form input[type="number"],
.add-form input[type="email"],
.add-form input[type="tel"],
.add-form textarea,
.add-form select {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box; /* So padding doesn't add to width */
}

.add-form textarea {
    height: 100px;
    resize: vertical;
}

.add-form .form-buttons {
    text-align: right;
}

.add-form .form-buttons .button {
    margin-left: 10px;
}

.hidden {
    display: none !important;
}

/* Inspection Room Styles */
.room-inspection-section {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
    padding: 10px;
}

.room-header {
    background-color: #e9e9e9;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.room-header:hover {
    background-color: #ddd;
}

.room-header.active {
    background-color: #007bff;
    color: white;
}

.room-header h5 {
    margin: 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

.room-data-indicator {
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    margin-left: 10px;
    font-weight: bold;
}

.room-data-indicator.has-data {
    background-color: #28a745;
}

.room-data-indicator.no-data {
    background-color: #6c757d;
}

.room-content {
    padding: 10px 0 0 0;
    border-top: 1px solid #ddd;
    margin-top: 10px;
}

.room-content label {
    margin-top: 10px;
}

.room-content textarea {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    min-height: 60px;
}

.photos-container {
    margin-top: 10px;
}

.photo-entry {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    position: relative;
}

.photo-entry:last-child {
    margin-bottom: 10px;
}

.photo-controls {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.photo-controls input[type="file"] {
    margin-right: 10px;
    flex: 1;
}

.remove-photo-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.remove-photo-btn:hover {
    background-color: #c82336;
}

.photo-preview {
    max-width: 200px;
    max-height: 150px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 10px;
    object-fit: cover;
}

.photo-preview-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.photo-info {
    flex: 1;
}

.photo-entry textarea {
    width: 100%;
    min-height: 40px;
    margin-bottom: 0;
    box-sizing: border-box;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #336;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-loading {
    position: relative;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.form-loading::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    content: "Saving...";
    color: #007bff;
    font-weight: bold;
    z-index: 12;
}

/* Navigation Styles */
.main-nav {
    background-color: #f8f9fa;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 5px;
    text-align: center;
}

.nav-button {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background: #dee2e6;
}

.nav-button.active {
    background: #336;
    color: #fff;
}

/* Section Styles */
.section {
    display: none;
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    margin: 0;
    color: #336;
}

/* Dashboard Styles */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.summary-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
    border-left: 4px solid #336;
}

.summary-card h3 {
    margin: 0 0 1rem 0;
    color: #336;
    font-size: 1.1em;
}

.summary-card p {
    margin: 0.5rem 0;
    font-size: 0.9em;
    color: #6c757d;
}

/* Form Styles */
.form-container {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 5px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.form-container h3 {
    margin: 0 0 1.5rem 0;
    color: #336;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #336;
    box-shadow: 0 0 0 2px rgba(51, 51, 102, 0.2);
}

.form-actions {
    text-align: right;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.form-actions .button {
    margin-left: 0.5rem;
}

/* Button Styles */
.button-secondary {
    background: #6c757d !important;
}

.button-secondary:hover {
    background: #5a6268 !important;
}

/* User Info Styles */
.user-info {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    text-align: right;
    border: 1px solid #e9ecef;
}

/* Error and Loading Styles */
.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem;
    border-radius: 3px;
    margin: 1rem 0;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Table Responsive */
@media (max-width: 768px) {
    .dashboard-summary {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .main-nav {
        padding: 0.5rem;
    }
    
    .nav-button {
        display: block;
        margin: 0.2rem 0;
        width: 100%;
    }
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
}

.error.hidden {
    display: none;
}

/* Section Tables */
.section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.section table th,
.section table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.section table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.section table tbody tr:hover {
    background-color: #f8f9fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .section table {
        font-size: 0.875rem;
    }
    
    .section table th,
    .section table td {
        padding: 0.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Connectivity Banner */
.banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  z-index: 1000;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-info {
  background-color: #e3f2fd;
  color: #1976d2;
}

.banner-success {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.banner-warning {
  background-color: #fff3e0;
  color: #f57c00;
}

.banner-error {
  background-color: #fdecea;
  color: #d32f2f;
}

.banner-message {
  flex-grow: 1;
  margin-right: 16px;
}

.banner-action {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  margin-right: 16px;
  background-color: currentColor;
  color: white;
}

.banner-action:hover {
  opacity: 0.9;
}

.banner-close {
  background: none;
  border: none;
  color: currentColor;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  opacity: 0.7;
}

.banner-close:hover {
  opacity: 1;
} 

/* Inspection Performance Styles */
.inspection-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #336;
    border-bottom: 2px solid #336;
    padding-bottom: 10px;
}

.rooms-list {
    display: grid;
    gap: 20px;
}

.room-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #ddd;
}

.room-card.pending {
    border-left-color: #ffc107;
}

.room-card.in-progress {
    border-left-color: #007bff;
}

.room-card.completed {
    border-left-color: #28a745;
}

.room-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.room-title {
    margin: 0;
    color: #336;
}

.room-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.room-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.room-status.in-progress {
    background-color: #cce5ff;
    color: #004085;
}

.room-status.completed {
    background-color: #d4edda;
    color: #155724;
}

.room-content-card {
    margin-bottom: 20px;
}

.room-notes-section {
    margin-bottom: 20px;
}

.room-notes-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #336;
}

.room-notes-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.photos-section {
    margin-bottom: 20px;
}

.photos-section h4 {
    margin-bottom: 15px;
    color: #336;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.photo-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-notes {
    padding: 10px;
}

.photo-notes textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
    font-size: 0.9em;
}

.photo-actions {
    padding: 10px;
    border-top: 1px solid #ddd;
    background: white;
    text-align: right;
}

.room-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.room-actions .button {
    margin: 0;
}

.progress-bar {
    background-color: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-weight: bold;
    color: #336;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
    color: #336;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .inspection-info {
        grid-template-columns: 1fr;
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .room-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .room-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* Sync Status and Progress Styles */
.section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sync-status-container {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.sync-status-indicator {
    margin-bottom: 10px;
}

.sync-pending {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 500;
}

.sync-current {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 500;
}

.sync-progress {
    margin-top: 10px;
}

.sync-progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sync-progress-fill {
    height: 100%;
    background-color: #007bff;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.sync-progress-text {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

.button-primary {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.button-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.button-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .section-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-actions .button {
        margin-bottom: 5px;
    }
    
    .sync-status-container {
        padding: 10px;
    }
}

/* Update Banner and Notification Styles */
.update-banner {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: all 0.3s ease;
    border-bottom: 3px solid #004085;
}

.update-banner.show {
    top: 0;
}

.update-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.update-message {
    flex: 1;
}

.update-message strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.update-message p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.update-message.error {
    color: #dc3545;
}

.update-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.update-actions .button {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-actions .button-primary {
    background-color: white;
    color: #007bff;
    font-weight: 600;
}

.update-actions .button-primary:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
}

.update-actions .button-secondary {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.update-actions .button-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.update-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Temporary Message Styles */
.temporary-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.temporary-message.show {
    transform: translateX(0);
}

.temporary-message.success {
    background-color: #28a745;
}

.temporary-message.error {
    background-color: #dc3545;
}

.temporary-message.info {
    background-color: #17a2b8;
}

/* Check for Updates Button Styles */
.check-updates-btn {
    position: relative;
    overflow: hidden;
}

.check-updates-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.check-updates-btn:hover::after {
    width: 100%;
    height: 100%;
}

/* Mobile Responsive Updates */
@media (max-width: 768px) {
    .update-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .update-actions {
        width: 100%;
        justify-content: center;
    }

    .update-actions .button {
        flex: 1;
        min-width: 100px;
    }

    .update-banner {
        padding: 12px 15px;
    }

    .temporary-message {
        right: 15px;
        left: 15px;
        transform: translateY(-100%);
    }

    .temporary-message.show {
        transform: translateY(0);
    }
}

/* User Info Section Update Button */
.user-info {
    position: relative;
}

.version-info {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
}

.update-available-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}