/* Madagascar JSON Schema Tools - Unified Stylesheet */

/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #0066ff 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* ===== HEADER STYLES ===== */
.header {
    background: linear-gradient(135deg, #01132e, #0066ff);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

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

.header p {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* ===== NAVIGATION LINKS ===== */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== AUTHENTICATION UI STYLES ===== */
.auth-section {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.9em;
    font-weight: 500;
}

.user-email {
    font-size: 0.8em;
    opacity: 0.8;
}

.logout-button {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: rgba(231, 76, 60, 1);
}

.auth-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

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

/* ===== FILE CONTROLS ===== */
.file-controls {
    background: #f8f9fa;
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}

.file-section {
    margin-bottom: 25px;
}

.file-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.file-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input {
    position: absolute;
    left: -9999px;
}

.file-input-button {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #3498db;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.file-input-button:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.file-input-button.schema {
    background: #e74c3c;
    border-color: #e74c3c;
}

.file-input-button.schema:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.file-input-button.batch {
    background: #8e44ad;
    border-color: #8e44ad;
}

.file-input-button.batch:hover {
    background: #7d3c98;
    border-color: #7d3c98;
}

.file-input-button.json {
    background: #27ae60;
    border-color: #27ae60;
}

.file-input-button.json:hover {
    background: #229954;
    border-color: #229954;
}

.current-file {
    color: #7f8c8d;
    font-size: 0.9em;
    padding: 8px 15px;
    background: white;
    border-radius: 20px;
    border: 2px solid #ecf0f1;
    flex: 1;
    min-width: 200px;
}

/* ===== LOADING INDICATORS ===== */
.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8em;
}

.validate-button {
    background: #27ae60;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.validate-button:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-1px);
}

.validate-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.generate-button {
    background: #e74c3c;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: 500;
    margin-left: 15px;
}

.generate-button:hover {
    background: #c0392b;
}

.generate-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* ===== TOOLBAR ===== */
.toolbar {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== RESULTS CONTAINER ===== */
.results-container {
    padding: 30px;
    min-height: 300px;
}

.results-container.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 400px;
}

/* ===== SUCCESS RESULTS ===== */
.result-success {
    background: #d5edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    color: #155724;
}

.result-success h3 {
    color: #27ae60;
    margin-bottom: 10px;
    font-size: 1.5em;
}

/* ===== ERROR RESULTS ===== */
.result-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    color: #721c24;
}

.result-error h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.error-list {
    max-height: 400px;
    overflow-y: auto;
}

.error-item {
    background: white;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
}

.error-path {
    font-weight: 600;
    color: #c0392b;
    margin-bottom: 5px;
}

.error-message {
    color: #721c24;
    font-size: 0.95em;
}

.error-details {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

/* ===== ERROR MESSAGE BANNER ===== */
.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 30px;
    display: none;
}

.success-message {
    background: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px;
    display: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #95a5a6;
}

.empty-state p {
    font-size: 1em;
    line-height: 1.6;
    opacity: 0.8;
}

/* ===== VALIDATION STATS ===== */
.validation-stats {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    justify-content: center;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    padding: 10px;
}

.stat-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9em;
}

.stat.success .stat-number {
    color: #27ae60;
}

.stat.error .stat-number {
    color: #e74c3c;
}

/* ===== BATCH RESULTS ===== */
.batch-results {
    max-height: 500px;
    overflow-y: auto;
    margin-top: 15px;
}

.batch-file-result {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.batch-file-result.success {
    border-left: 4px solid #27ae60;
}

.batch-file-result.error {
    border-left: 4px solid #e74c3c;
}

.batch-file-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.batch-file-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.batch-file-error-count {
    font-size: 0.9em;
    color: #7f8c8d;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== CODE BLOCKS ===== */
.code-block {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-preview {
    background: #34495e;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

/* ===== COPY AND DOWNLOAD BUTTONS ===== */
.copy-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background: #2980b9;
}

.copy-button.copied {
    background: #27ae60;
}

.download-button {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.download-button:hover {
    background: #8e44ad;
}

/* ===== SCHEMA STATS ===== */
.schema-stats {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-top: 5px;
}

/* ===== GENERATION OPTIONS ===== */
.generation-options {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.option-group {
    margin-bottom: 10px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #2c3e50;
    cursor: pointer;
}

.option-group input[type="checkbox"] {
    transform: scale(1.1);
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.toggle-button {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.toggle-button.active {
    background: #e74c3c;
}

.toggle-button:hover {
    background: #7f8c8d;
}

.toggle-button.active:hover {
    background: #c0392b;
}

/* ===== MAIN CONTENT GRID ===== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.schema-panel, .preview-panel {
    padding: 20px;
    overflow-y: auto;
    max-height: 70vh;
}

.schema-panel {
    border-right: 1px solid #e9ecef;
    background: #f8f9fa;
}

.preview-panel {
    background: #2c3e50;
    color: #ecf0f1;
}

/* ===== PANEL HEADERS ===== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.preview-panel .panel-header {
    border-bottom-color: #4a90e2;
}

.panel-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
}

.preview-panel .panel-title {
    color: #ecf0f1;
}

/* ===== SCHEMA TREE ===== */
.schema-tree {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.schema-property {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.schema-property:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.property-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    gap: 10px;
}

.collapse-toggle {
    background: none;
    border: none;
    font-size: 1em;
    cursor: pointer;
    padding: 4px 8px;
    color: #2c3e50;
    transition: all 0.2s ease;
    line-height: 1;
    border-radius: 4px;
}

.collapse-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.collapse-toggle.collapsed {
    transform: rotate(0deg);
}

.collapse-placeholder {
    width: 32px;
    display: inline-block;
}

.property-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.property-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
}

.property-type {
    background: #3498db;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.property-type.object { background: #e74c3c; }
.property-type.array { background: #f39c12; }
.property-type.string { background: #27ae60; }
.property-type.integer { background: #8e44ad; }
.property-type.number { background: #9b59b6; }
.property-type.boolean { background: #16a085; }

.required-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 500;
}

.property-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.action-btn.preview { color: #9b59b6; }
.action-btn.edit { color: #3498db; }
.action-btn.add { color: #27ae60; }
.action-btn.delete { color: #e74c3c; }

.property-editor {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: none;
}

.property-editor.active {
    display: block;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header.child-property {
    background: linear-gradient(135deg, #3498db, #5dade2);
}

.modal-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

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

.add-property-form {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    display: block;
}

/* ===== CHILDREN CONTAINER ===== */
.children-container {
    margin-left: 20px;
    border-left: 2px solid #ecf0f1;
    padding-left: 15px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 5000px;
    opacity: 1;
    overflow: hidden;
}

.children-container.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.children-container.array-items {
    border-left-color: #f39c12;
}

.array-items-label {
    font-size: 0.8em;
    color: #f39c12;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== STATS BAR ===== */
.stats-bar {
    background: #34495e;
    color: #ecf0f1;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-info {
    display: flex;
    gap: 20px;
}

/* ===== VISUALIZATION CONTAINER ===== */
.visualization-container {
    padding: 30px;
    background: #2c3e50;
    min-height: 600px;
    overflow: auto;
    position: relative;
}

.json-tree {
    position: relative;
    padding: 20px;
}

.json-node {
    position: relative;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.node-box {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border: 2px solid #4a90e2;
    border-radius: 8px;
    padding: 12px 16px;
    color: #ecf0f1;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.node-box:hover {
    border-color: #5dade2;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.node-box.object {
    border-color: #e74c3c;
}

.node-box.array {
    border-color: #f39c12;
}

.node-box.string {
    border-color: #27ae60;
}

.node-box.number {
    border-color: #9b59b6;
}

.node-box.boolean {
    border-color: #e67e22;
}

.node-box.null {
    border-color: #95a5a6;
}

.node-key {
    color: #5dade2;
    font-weight: bold;
    margin-bottom: 4px;
}

.node-type {
    color: #f39c12;
    font-size: 0.8em;
    opacity: 0.8;
    margin-bottom: 4px;
}

.node-value {
    color: #ecf0f1;
    word-break: break-all;
    max-width: 300px;
}

.node-value.truncated {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.node-value.truncated::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent, #34495e 50%);
    padding-left: 20px;
}

.expand-button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.expand-button:hover {
    background: #2980b9;
}

.connection-line {
    position: absolute;
    background: #4a90e2;
    z-index: 1;
}

.connection-line.horizontal {
    height: 2px;
    left: -20px;
    top: 50%;
    width: 20px;
}

.connection-line.vertical {
    width: 2px;
    left: -20px;
    top: 0;
    bottom: 50%;
}

/* ===== STATS PANEL ===== */
.stats-panel {
    background: #34495e;
    color: #ecf0f1;
    padding: 20px;
    border-top: 1px solid #4a90e2;
}

.stats-panel .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stats-panel .stat-item {
    text-align: center;
    background: rgba(52, 73, 94, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #4a90e2;
}

.stats-panel .stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #5dade2;
    margin-bottom: 5px;
}

.stats-panel .stat-label {
    font-size: 0.9em;
    opacity: 0.8;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .schema-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }

    .file-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .current-file {
        min-width: auto;
    }

    .results-container {
        padding: 15px;
    }

    .auth-section {
        position: static;
        justify-content: center;
        margin-top: 15px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .file-controls {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .results-container.grid {
        grid-template-columns: 1fr;
    }
    
    .generate-button {
        margin-left: 0;
        margin-top: 10px;
    }

    .node-box {
        min-width: 150px;
    }
    
    .children-container {
        margin-left: 20px;
    }
}

/* Tool Cards Styles */
.tools-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 2rem;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: block;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.tool-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    text-align: center;
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: #2c3e50;
}

.tool-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    text-align: center;
    margin: 0;
}

/* Responsive design for tool cards */
@media (max-width: 768px) {
    .tools-section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .tool-icon {
        font-size: 2.5rem;
    }
    
    .tool-title {
        font-size: 1.3rem;
    }
}