/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #2d3748;
    line-height: 1.6;
}

/* App container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #00ed64 0%, #00c851 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 237, 100, 0.2);
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo i {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Search container */
.search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    z-index: 1;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

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

.result-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-title {
    font-weight: 500;
    color: #2d3748;
    margin: 0;
}

.result-type {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.result-type.cluster {
    background-color: #e6fffa;
    color: #00b894;
}

.result-type.table {
    background-color: #ebf8ff;
    color: #3182ce;
}

.result-type.field {
    background-color: #faf5ff;
    color: #805ad5;
}

.result-description {
    font-size: 0.875rem;
    color: #718096;
    margin: 0;
}

/* Header actions */
.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn-primary, .btn-secondary, .btn-logout {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #00ed64 0%, #00c851 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00d55a 0%, #00b847 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-logout {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Stop Export Button */
.btn-stop-export {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-stop-export:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main layout */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}



/* Tree view */
.tree-view {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.tree-item {
    margin-bottom: 0.5rem;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tree-node:hover {
    background-color: #f7fafc;
}

.tree-node.active {
    background-color: #e6fffa;
    color: #00b894;
}

.tree-node.selected {
    background-color: #00ed64;
    color: white;
}

.tree-toggle {
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: #718096;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.tree-toggle.expandable:hover {
    color: #00ed64;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-icon {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
    color: #718096;
}

.tree-node.selected .tree-icon {
    color: white;
}

.tree-label {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.tree-children {
    margin-left: 1.5rem;
    border-left: 1px solid #e2e8f0;
    padding-left: 0.5rem;
    margin-top: 0.25rem;
    display: none;
    animation: slideDown 0.2s ease-out;
}

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

/* Recently viewed */
.recently-viewed {
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
    max-height: 200px;
    overflow-y: auto;
}

.recently-viewed h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.recent-item {
    display: flex;
    align-items: center;
    padding: 0.375rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 0.125rem;
}

.recent-item:hover {
    background-color: #f7fafc;
}

.recent-item i {
    margin-right: 0.5rem;
    color: #718096;
    width: 1rem;
    text-align: center;
}

.recent-item span {
    font-size: 0.75rem;
    color: #4a5568;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.breadcrumb {
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #718096;
}

.breadcrumb-item {
    position: relative;
}

.breadcrumb-item:not(:last-child):after {
    content: '/';
    margin: 0 0.5rem;
    color: #cbd5e0;
}

.breadcrumb-item:last-child {
    color: #2d3748;
    font-weight: 500;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Welcome screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-icon {
    font-size: 4rem;
    color: #00ed64;
    margin-bottom: 1.5rem;
}

.welcome-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.welcome-content p {
    font-size: 1.125rem;
    color: #718096;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* Quick stats */
.quick-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    min-width: 140px;
}

.stat-card i {
    font-size: 2rem;
    color: #00ed64;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Content views */
.cluster-view, .table-view, .field-view {
    animation: fadeIn 0.3s ease;
}

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

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.content-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-title i {
    font-size: 1.5rem;
    color: #00ed64;
}

.content-title h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
}

.content-actions {
    display: flex;
    gap: 0.75rem;
}

.description-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.description-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.description-card p {
    color: #718096;
    line-height: 1.6;
}

/* Tables grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.table-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #00ed64;
}

.table-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.table-card-header i {
    font-size: 1.25rem;
    color: #3182ce;
}

.table-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
}

.table-card-description {
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.table-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #a0aec0;
}

/* Fields table */
.fields-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.fields-table th {
    background: #f7fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
    border-bottom: 1px solid #e2e8f0;
}

.fields-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.fields-table tr:hover {
    background-color: #f7fafc;
}

.field-name {
    font-weight: 500;
    color: #2d3748;
}

.field-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #edf2f7;
    color: #4a5568;
}

.field-required {
    color: #e53e3e;
    font-weight: 500;
}

/* Right panel */
.right-panel {
    width: 280px;
    background: white;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.panel-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.panel-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.25);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #718096;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

/* Field details modal */
.field-details {
    padding: 1rem 0;
}

.field-header {
    margin-bottom: 2rem;
}

.field-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.field-title i {
    font-size: 2rem;
    color: #00ed64;
}

.field-title h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.field-info {
    margin-bottom: 2rem;
}

.info-row {
    display: flex;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 120px;
    margin-right: 1rem;
}

.info-value {
    color: #2d3748;
    flex: 1;
}

.field-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Cluster details modal */
.cluster-details {
    padding: 1rem 0;
}

.cluster-header {
    margin-bottom: 2rem;
}

.cluster-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cluster-title i {
    font-size: 2rem;
    color: #00ed64;
}

.cluster-title h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.cluster-info {
    margin-bottom: 2rem;
}

.cluster-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.status-active {
    color: #00ed64;
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 1024px) {
    .right-panel {
        display: none;
    }
    
    .sidebar {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .search-container {
        order: 1;
        width: 100%;
    }
    
    .header-actions {
        order: 2;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .tree-view {
        padding: 0.5rem;
    }
    
    .recently-viewed {
        display: none;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .quick-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .tables-grid {
        grid-template-columns: 1fr;
    }
}

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

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.highlight {
    background-color: #fef5e7;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

/* Highlighted search term */
mark {
  background: #FEF537;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 500;
}

/* No results found styling */
.search-result-item.no-results {
  padding: 20px 24px 16px 24px;
  text-align: left;
  box-shadow: none;
  background: transparent;
}
.no-results-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #222;
  margin-bottom: 4px;
}
.no-results-desc {
  color: #7b8794;
  font-size: 0.98rem;
  font-weight: 400;
  margin: 0;
}

/* Loading and error message styles */
.loading-placeholder {
    color: #6c757d;
    font-style: italic;
    padding: 8px;
    text-align: center;
}

.error-message {
    color: #dc3545;
    font-style: italic;
    padding: 8px;
    text-align: center;
}

/* Fields table styling */
.fields-table {
    margin-top: 1rem;
}

.fields-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fields-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.fields-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fields-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #2d3748;
    font-size: 0.875rem;
}

.fields-table tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.fields-table tbody tr:hover {
    background-color: #f8fafc;
}

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

.field-type {
    display: inline-block;
    background: #e6f3ff;
    color: #0066cc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Collection Creation Modal Styles */
.modal-large {
    max-width: 600px;
    width: 90%;
}

.modal-extra-large {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
}

.modal-extra-large .modal-body {
    max-height: 70vh;
    padding: 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

/* Field Row Styles */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px 2fr auto auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.field-row input[type="text"],
.field-row input[type="number"],
.field-row select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.field-row input[type="text"]:focus,
.field-row input[type="number"]:focus,
.field-row select:focus {
    outline: none;
    border-color: #00ed64;
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.1);
}

.field-description {
    min-width: 200px;
}

.field-required {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568;
    white-space: nowrap;
}

.field-required input[type="checkbox"] {
    margin: 0;
}

.btn-remove-field {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.btn-remove-field:hover {
    background: #dc2626;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ed64;
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #718096;
}

/* Field Management Styles */
.field-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.field-row input,
.field-row select {
    flex: 1;
    margin-bottom: 0;
}

.field-row input[name*="[name]"] {
    flex: 1.2;
}

.field-row select[name*="[type]"] {
    flex: 0.8;
}

.field-row input[name*="[description]"] {
    flex: 1.5;
}

.btn-remove-field {
    background: #fed7d7;
    color: #c53030;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.btn-remove-field:hover {
    background: #feb2b2;
}

.field-required {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568;
    white-space: nowrap;
    flex-shrink: 0;
}

.field-required input[type="checkbox"] {
    margin: 0;
    width: auto;
}

.btn-add-field {
    background: #e6f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add-field:hover {
    background: #cce7ff;
    border-color: #80bfff;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #00ed64 0%, #00c851 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 237, 100, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Loading States */
button.btn-primary.btn-loading {
    position: relative;
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #ffffff !important;
}

button.btn-primary.btn-loading:hover {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #ffffff !important;
}

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

/* Table Card Actions */
.table-card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.table-card {
    position: relative;
}

.table-card:hover .table-card-actions {
    opacity: 1;
}

.table-edit-btn, .table-delete-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.table-edit-btn {
    color: #3b82f6 !important;
}

.table-edit-btn:hover {
    background-color: #3b82f6 !important;
    color: white !important;
}

.table-edit-btn i {
    color: #3b82f6 !important;
}

.table-edit-btn:hover i {
    color: white !important;
}

.table-delete-btn {
    color: #ef4444 !important;
}

.table-delete-btn:hover {
    background-color: #ef4444 !important;
    color: white !important;
}

.table-delete-btn i {
    color: #ef4444 !important;
}

.table-delete-btn:hover i {
    color: white !important;
}

/* Danger Button */
.btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

.btn-danger:disabled {
    background-color: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
}

button.btn-danger.btn-loading {
    position: relative;
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #ffffff !important;
}

button.btn-danger.btn-loading:hover {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #ffffff !important;
}

/* Error States */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

/* Success States */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #00ed64;
    box-shadow: 0 0 0 3px rgba(0, 237, 100, 0.1);
}

/* Collection Fields Display Styles */
.collection-fields-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.collection-fields-info h4 {
    color: #0369a1;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.collection-fields-info p {
    color: #0c4a6e;
    margin: 0;
    font-size: 0.875rem;
}

.fields-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.field-summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.field-summary-card .field-count {
    font-size: 2rem;
    font-weight: 700;
    color: #00ed64;
    margin-bottom: 0.25rem;
}

.field-summary-card .field-label {
    color: #4a5568;
    font-size: 0.875rem;
    font-weight: 500;
}

.fields-table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.fields-table-header {
    background: #f8fafc;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.fields-table-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
}

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

.fields-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.fields-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #2d3748;
    font-size: 0.875rem;
}

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

.fields-table tbody tr:hover {
    background-color: #f8fafc;
}

.field-type-badge {
    display: inline-block;
    background: #e6f3ff;
    color: #0066cc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.field-type-badge.string { background: #e6f3ff; color: #0066cc; }
.field-type-badge.number { background: #f0fdf4; color: #16a34a; }
.field-type-badge.boolean { background: #fef3c7; color: #d97706; }
.field-type-badge.date { background: #fce7f3; color: #be185d; }
.field-type-badge.array { background: #ede9fe; color: #7c3aed; }
.field-type-badge.object { background: #f3e8ff; color: #9333ea; }

.no-fields-message {
    text-align: center;
    padding: 2rem;
    color: #718096;
    font-style: italic;
}

.loading-fields {
    text-align: center;
    padding: 2rem;
    color: #4a5568;
}

.loading-fields i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* No Data Message */
.no-data-message {
    text-align: center;
    padding: 2rem;
    color: #718096;
    font-style: italic;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px dashed #e2e8f0;
    margin: 0.5rem;
}

/* Navigation No Data Message */
.nav-no-data-message {
    font-size: 0.85rem;
    color: #a0aec0;
    font-style: italic;
    padding: 0.5rem 0;
}

/* No Tables Message - Main Content Area */
.no-tables-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #718096;
    background: transparent;
}

.no-tables-message i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.no-tables-message p {
    font-size: 1.1rem;
    font-style: italic;
    margin: 0;
    color: #718096;
}

/* Table Edit Button */
.table-edit-btn {
    position: absolute;
    top: 0.1rem;
    right: 1.6rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    z-index: 10;
}

.table-card:hover .table-edit-btn {
    opacity: 1;
}

.table-edit-btn:hover {
    background: #00ed64;
    color: white;
    border-color: #00ed64;
    transform: scale(1.05);
}

.table-edit-btn i {
    font-size: 0.75rem;
}

/* Global Loader */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.global-loader.show {
    opacity: 1;
}

.loader-content {
    background: white;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #00ed64;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    font-size: 1rem;
    font-weight: 500;
    color: #4a5568;
    text-align: center;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .no-tables-message {
        padding: 2rem 1rem;
    }
    
    .no-tables-message i {
        font-size: 2.5rem;
    }
    
    .no-tables-message p {
        font-size: 1rem;
    }
    
    .loader-content {
        padding: 1.5rem 2rem;
        min-width: 160px;
    }
    
    .loader-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    .loader-text {
        font-size: 0.9rem;
    }
}

/* Validation Button Styles */
.btn-validation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 2.5rem;
    justify-content: center;
    flex-shrink: 0;
}

.btn-validation:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.validation-status {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Validation Modal Styles */
.validation-form {
    max-height: 70vh;
    overflow-y: auto;
}

.validation-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.validation-info p {
    margin: 0.25rem 0;
    color: #4a5568;
}

.validation-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.validation-section {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.validation-section h4 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-options {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.validation-option {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.validation-option label {
    font-weight: 500;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}


.validation-option select[required] {
    border-left: 3px solid #dc2626;
}

.validation-option label input[type="checkbox"] {
    margin: 0;
    width: auto;
}

.validation-label {
    font-weight: 500;
    color: #2d3748;
}

.validation-option input,
.validation-option textarea,
.validation-option select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

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

.validation-option small {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.validation-option textarea {
    resize: vertical;
    min-height: 3rem;
}

/* Range inputs styling */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-inputs input {
    flex: 1;
    min-width: 80px;
}

.range-separator {
    font-weight: bold;
    color: #6b7280;
    font-size: 1.1rem;
}

/* Field row adjustments for validation button */
.field-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.field-row input,
.field-row select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    min-width: 120px;
}

.field-row input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.field-description {
    flex: 1.5;
    min-width: 200px;
}

.foreign-key-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
    align-items: flex-start;
}

.foreign-key-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    cursor: pointer;
}

.foreign-key-checkbox input[type="checkbox"] {
    margin: 0;
    width: auto;
}

.foreign-key-table-select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s ease;
    width: 100%;
    min-width: 150px;
}

.foreign-key-table-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


.btn-remove-field {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-remove-field:hover {
    background: #dc2626;
}

/* Mobile responsive adjustments for validation */
@media (max-width: 768px) {
    .field-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .field-row input,
    .field-row select {
        width: 100%;
        min-width: auto;
    }
    
    .validation-options {
        gap: 0.75rem;
    }
}