* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 100px 10px 10px 10px;
}

.container {
    
    width: 100%;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.developer-selection {
    margin-bottom: 30px;
    text-align: center;
}

.developer-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.developer-select {
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 250px;
    transition: all 0.3s;
}

.developer-select:hover {
    border-color: #764ba2;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.developer-select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.upload-box {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: #764ba2;
    background: #e8eaff;
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: #667eea;
    stroke-width: 2;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.upload-subtext {
    color: #666;
    font-size: 0.95rem;
}

.file-info {
    margin-top: 20px;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.file-info p {
    margin: 5px 0;
    color: #333;
}

.file-info strong {
    color: #667eea;
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #333;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.mapping-instructions {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.mapping-instructions p {
    color: #92400e;
    margin: 0;
}

.mapping-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mapping-section {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    background: #f9fafb;
}

.mapping-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.2rem;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
}

.mapping-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.mapping-row:last-child {
    margin-bottom: 0;
}

.mapping-row label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.column-select {
    padding: 10px 14px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.column-select:hover {
    border-color: #667eea;
}

.column-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 32px;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(56, 239, 125, 0.4);
}

.btn-success:active {
    transform: translateY(0);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Project Search Modal Styles */
.search-info {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.search-info p {
    margin: 6px 0;
    color: #92400e;
    font-size: 0.95rem;
}

.search-info .warning-text {
    font-weight: 600;
    margin-top: 12px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f9fafb;
}

.search-result-item.selected {
    background: #ede9fe;
    border-left: 4px solid #667eea;
}

.search-result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-result-id {
    font-size: 0.85rem;
    color: #6b7280;
}

.select-btn {
    padding: 6px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.select-btn:hover {
    background: #764ba2;
    transform: translateY(-1px);
}

.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}

/* Preview Modal Styles */
.preview-modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
}

.preview-info {
    background: #f0f9ff;
    border-left: 4px solid #667eea;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-info p {
    margin: 6px 0;
    color: #333;
    font-size: 0.95rem;
}

.preview-info strong {
    color: #667eea;
}

.preview-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
    background: #f9fafb;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

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

.preview-section {
    margin-bottom: 0;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.table-controls span {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
}

.btn-secondary {
    padding: 8px 16px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.table-preview {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.table-preview.scrollable {
    max-height: 400px;
    overflow-y: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.preview-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-table thead th {
    color: white;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border: none;
    text-transform: capitalize;
}

.preview-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.preview-table tbody tr:last-child {
    border-bottom: none;
}

.preview-table tbody tr:hover {
    background: #f9fafb;
}

.preview-table tbody td {
    padding: 10px 16px;
    color: #333;
    border: none;
    position: relative;
}

.preview-table tbody td:empty::after {
    content: '-';
    color: #9ca3af;
}

.preview-table.editable tbody td {
    cursor: pointer;
    transition: background 0.2s;
}

.preview-table.editable tbody td:hover {
    background: #fef3c7 !important;
    outline: 2px solid #f59e0b;
}

.preview-table tbody td input {
    width: 100%;
    padding: 8px;
    border: 2px solid #667eea;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
}

.preview-table tbody td input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.preview-table tbody td.editing {
    padding: 2px;
    background: white !important;
}

.preview-table tbody tr.deleted {
    opacity: 0.5;
    text-decoration: line-through;
    background: #fee2e2 !important;
}

.delete-row-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 8px;
    transition: all 0.2s;
}

.delete-row-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Update Progress Modal */
.large-modal {
    max-width: 900px;
    width: 90%;
}

.update-status {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-indicator span {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
}

.update-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.update-summary h3 {
    margin-bottom: 16px;
    color: #111827;
    font-size: 1.1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.summary-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.summary-value {
    font-size: 1.1rem;
    color: #111827;
    font-weight: 600;
}

.logs-container {
    margin-top: 20px;
}

.logs-container h3 {
    margin-bottom: 12px;
    color: #111827;
    font-size: 1.1rem;
}

.logs-output {
    background: #1f2937;
    color: #f3f4f6;
    border-radius: 8px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.log-entry.info {
    background: rgba(59, 130, 246, 0.1);
}

.log-entry.success {
    background: rgba(34, 197, 94, 0.1);
}

.log-entry.error {
    background: rgba(239, 68, 68, 0.1);
}

.log-entry.warning {
    background: rgba(245, 158, 11, 0.1);
}

.log-entry.progress {
    background: rgba(168, 85, 247, 0.1);
}

.log-timestamp {
    color: #9ca3af;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.log-icon {
    flex-shrink: 0;
}

.log-message {
    flex: 1;
}

/* Responsive */
@media (max-width: 640px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .upload-section {
        padding: 24px;
    }

    .upload-box {
        padding: 40px 20px;
    }

    .mapping-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .preview-table {
        font-size: 0.8rem;
    }

    .preview-table thead th,
    .preview-table tbody td {
        padding: 8px 10px;
    }
}

/* Projects Units Section */
.projects-units-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
    font-size: 1.5rem;
}

#unitsTableContainer {
    margin-top: 20px;
}

.table-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid #5568d3;
}

.data-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

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

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 12px 15px;
    color: #333;
    font-size: 0.9rem;
}

.data-table td:first-child {
    font-weight: 600;
    color: #667eea;
}

/* ============================================
   NAVIGATION BAR STYLES
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-link.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.nav-link.logout-btn {
    color: #ff4757;
    border: 1px solid #ff4757;
}

.nav-link.logout-btn:hover {
    color: white;
    background: #ff4757;
}

/* Dropdown Styles */
.nav-item.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    margin-left: 4px;
}

.nav-item.dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 220px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 8px;
}

.nav-item.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding-left: 24px;
}

.dropdown-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    font-weight: 600;
}

/* Dropdown indicator for active parent */
.nav-item.dropdown.active > .dropdown-toggle {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px 20px;
        gap: 10px;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 5px;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-left: 3px solid #667eea;
        margin-left: 15px;
        margin-top: 5px;
        transform: none;
    }
    
    .dropdown-item:hover {
        padding-left: 20px;
    }
}

/* Adjust body padding for navbar */
body {
    padding-top: 80px;
}

/* ============================================
   CREATE PROJECT PAGE STYLES
   ============================================ */
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.step.active .step-number {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.step-label {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.form-section h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.section-description {
    color: #666;
    margin-bottom: 25px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group .required {
    color: #ef4444;
}

.form-group .input-help,
small.input-help {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
}

.form-group .char-counter {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-align: right;
    margin-top: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* Unit Types Styles */
.unit-type-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
}

/* Container for 2-column layout */
#unitTypesContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Responsive: 1 column on smaller screens */
@media (max-width: 1024px) {
    #unitTypesContainer {
        grid-template-columns: 1fr;
    }
}

.unit-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.unit-type-header h4 {
    color: #333;
    font-size: 1.1rem;
}

.unit-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Floor plan preview styles */
.floor-plan-preview-container {
    grid-column: span 2;
    margin-top: 10px;
}

.floor-plan-preview {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid #e0e0e0;
    background: white;
    padding: 10px;
}

.floor-plan-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.no-preview {
    color: #999;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Fullscreen overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.2);
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon.btn-danger {
    background: #fee2e2;
    color: #ef4444;
}

.btn-icon.btn-danger:hover {
    background: #ef4444;
    color: white;
}

/* Media Upload Styles */
.media-urls-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.media-urls-section h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.media-url-entry {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    align-items: center;
}

.image-preview-container {
    display: none;
    margin-bottom: 10px;
    text-align: center;
}

.image-preview-container img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #ddd;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-preview-error {
    display: none;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
}

.media-url-entry .url-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.media-url-entry input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.media-url-entry select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    min-width: 140px;
}

.media-url-entry .remove-url-btn {
    padding: 8px 12px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
}

.media-url-entry .remove-url-btn:hover {
    background: #c82333;
}

#mediaUrlsContainer {
    margin-bottom: 15px;
}

.media-upload-section {
    margin-bottom: 30px;
}

.media-upload-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.media-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.media-dropzone:hover,
.media-dropzone.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.media-dropzone svg {
    color: #94a3b8;
    margin-bottom: 15px;
}

.media-dropzone p {
    color: #64748b;
    margin-bottom: 5px;
}

.media-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.media-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
}

.media-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-item .remove-media {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.media-preview-item .media-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.static-files-info {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.static-files-info h3 {
    color: #065f46;
    margin-bottom: 10px;
}

.static-files-info p {
    color: #047857;
    margin-bottom: 10px;
}

.static-files-info ul {
    list-style: none;
    padding-left: 0;
}

.static-files-info li {
    color: #065f46;
    padding: 5px 0;
}

/* Suggestions Dropdown */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #f0f4ff;
}

/* Review Section */
.review-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.review-card h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

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

.review-item {
    color: #555;
}

.review-item.full-width {
    grid-column: span 2;
}

.review-item strong {
    color: #333;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
}

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

.review-table th {
    background: #e0e0e0;
    font-weight: 600;
    color: #333;
}

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

.review-list li {
    padding: 8px 0;
    color: #555;
}

/* Progress Bar */
.progress-bar-container {
    background: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-status {
    text-align: center;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .unit-type-grid {
        grid-template-columns: 1fr;
    }
    
    .media-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .progress-steps {
        gap: 20px;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .review-grid {
        grid-template-columns: 1fr;
    }
    
    .review-item.full-width {
        grid-column: span 1;
    }
}

/* Test Mode Styles */
.test-mode-section {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px dashed #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.test-mode-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 1rem;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #f59e0b;
}

.checkbox-label {
    font-weight: 600;
    color: #92400e;
    font-size: 1.1rem;
}

.test-mode-description {
    color: #b45309;
    font-size: 0.9rem;
    margin-left: 32px;
    font-style: italic;
}

.test-mode-section.active {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}

.test-mode-section.active .checkbox-label {
    color: #065f46;
}

.test-mode-section.active .test-mode-description {
    color: #047857;
}

/* Update Project Page Styles */
.selected-project-card {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.selected-project-card h3 {
    color: #0369a1;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.project-details {
    margin-bottom: 15px;
}

.detail-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.detail-label {
    font-weight: 600;
    color: #0369a1;
    min-width: 120px;
}

.detail-value {
    color: #1e3a5f;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.existing-unit-types-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.existing-unit-types-section h3 {
    color: #334155;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.existing-unit-types-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.existing-unit-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

.ut-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ut-name {
    font-weight: 600;
    color: #1e293b;
}

.ut-details {
    font-size: 0.85rem;
    color: #64748b;
}

.ut-id {
    font-size: 0.8rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

.suggestion-item .project-id {
    display: inline-block;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 8px;
}

.suggestion-item .project-name {
    color: #1e293b;
}

.suggestion-item.no-results,
.suggestion-item.error {
    color: #94a3b8;
    cursor: default;
    font-style: italic;
}

.suggestion-item.error {
    color: #ef4444;
}

.review-unit-type {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.ut-review-details {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 4px;
}

/* Edit Modal Styles */
.modal-close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-header {
    position: relative;
}

.ut-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
}

.existing-unit-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.existing-unit-type-item:hover {
    border-color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

#editModal .modal-content {
    max-width: 600px;
}

#editModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

#editModal .form-group.full-width {
    grid-column: 1 / -1;
}

#editModal .modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

#editModal .btn-danger {
    margin-left: auto;
}

/* Count Badge */
.count-badge {
    display: inline-block;
    background: #0ea5e9;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Step 2 existing unit types */
#existingUnitTypesStep2 {
    margin-bottom: 25px;
}

#existingUnitTypesStep2 h3 {
    color: #334155;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

/* Tanami Scraper Styles */
.tanami-scraper-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border: 2px dashed #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.tanami-scraper-section h3 {
    color: #6366f1;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.tanami-source-info {
    margin-top: 10px;
    padding: 10px;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 4px solid #0369a1;
    font-size: 12px;
    color: #0369a1;
}

.tanami-source-info strong {
    display: block;
    margin-bottom: 4px;
}

#tanamiStatus {
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

#tanamiResults {
    animation: slideDown 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Button styles for Tanami section */
#fetchTanamiBtn,
#downloadJsonBtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

#downloadJsonBtn {
    background: #10b981;
}

#downloadJsonBtn:hover {
    background: #059669;
}

/* ============================================================================
   Get JSON Details Button & Modal Styles
   ============================================================================ */

.get-details-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.get-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.get-details-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.json-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.json-modal-content {
    background-color: white;
    margin: 50px auto;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

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

.json-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.json-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.json-modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.json-modal-close:hover {
    color: #000;
}

.json-modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.json-modal-body pre {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.json-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.download-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #e8e8e8;
}

/* ============================================================================
   FULLSCREEN IMAGE MODAL
   ============================================================================ */

.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal.show {
    display: block;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #fff;
    background: rgba(220, 53, 69, 0.8);
    transform: rotate(90deg);
}

#imageCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 40px;
        width: 50px;
        height: 50px;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 85vh;
    }
    
    #imageCaption {
        font-size: 14px;
        padding: 15px 0;
    }
}

