/* ==================== KSB Website Generator v3.0 - Main Styles ==================== */

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --schema: #9c27b0;
    --array-bg: #e8f0fe;
    --string-array-bg: #fff3e0;
}

/* ==================== GLOBAL STYLES ==================== */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ==================== NAVBAR ==================== */
.navbar-brand {
    font-weight: bold;
    font-size: 1.8rem;
}

/* ==================== CARDS ==================== */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    transition: transform 0.3s;
}
.card:hover {
    transform: translateY(-5px);
}
.card-header {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 20px;
    font-weight: 600;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 600;
}
.btn-primary:hover {
    background: linear-gradient(to right, var(--secondary), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.btn-schema {
    background: linear-gradient(to right, var(--schema), #5e35b1);
    border: none;
    color: white;
}
.btn-schema:hover {
    background: linear-gradient(to right, #5e35b1, var(--schema));
    color: white;
}

/* ==================== FORM ELEMENTS ==================== */
.form-control, .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.3s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* ==================== UPLOAD AREA ==================== */
.upload-area {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}
.upload-icon {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 20px;
}

/* ==================== FILE LIST ==================== */
.file-list {
    list-style: none;
    padding: 0;
}
.file-list li {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 5px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.badge-custom {
    background: var(--success);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: normal;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.spinner {
    width: 70px;
    height: 70px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== STEP INDICATOR ==================== */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}
.step-indicator:before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #e0e0e0;
    z-index: 1;
}
.step {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 15px;
}
.step-number {
    width: 40px;
    height: 40px;
    background: #e0e0e0;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
    transition: all 0.3s;
}
.step.active .step-number {
    background: var(--primary);
    color: white;
}
.step.completed .step-number {
    background: var(--success);
    color: white;
}

/* ==================== CHECKBOX GROUP ==================== */
.checkbox-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ==================== PREVIEW BOX ==================== */
.preview-box {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
}
.keyword-badge {
    display: inline-block;
    background: linear-gradient(45deg, #4cc9f0, #4361ee);
    color: white;
    padding: 8px 15px;
    margin: 5px;
    border-radius: 20px;
    font-size: 14px;
}

/* ==================== STATS BOX ==================== */
.stats-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin: 10px 0;
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--dark);
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

/* ==================== SYNONYM EDITOR ==================== */
.synonym-editor {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
}
.synonym-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}
.synonym-row input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.synonym-remove {
    color: #e74c3c;
    cursor: pointer;
    padding: 5px 10px;
}
.synonym-remove:hover {
    background: #ffebee;
    border-radius: 5px;
}
.json-editor {
    font-family: monospace;
    font-size: 12px;
    min-height: 200px;
}

/* ==================== SCHEMA GENERATOR STYLES ==================== */
.schema-list {
    background: white;
    max-height: 450px;
    overflow-y: auto;
    border-radius: 8px;
}
.schema-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
}
.schema-item:hover {
    background: #f0f7ff;
}
.schema-item.selected {
    background: #e3f2fd;
    border-left: 4px solid var(--schema);
}
.schema-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: #e0e0e0;
}

/* ==================== DUAL-MODE TABS ==================== */
.schema-mode-tabs {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 50px;
    display: inline-flex;
    margin-bottom: 15px;
}
.schema-mode-tab {
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.schema-mode-tab.active {
    background: var(--schema);
    color: white;
}

/* ==================== VISUAL EDITOR STYLES ==================== */
.schema-editor-panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    margin-bottom: 20px;
}
.schema-field-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.schema-array-container {
    background: var(--array-bg);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border: 1px dashed var(--schema);
}
.schema-string-array-container {
    background: var(--string-array-bg);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #ffb74d;
}
.schema-array-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    position: relative;
}
.schema-array-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.schema-preview {
    background: #1e1e2f;
    color: #d4d4d4;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    border-radius: 8px;
    padding: 15px;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}
.schema-preview .string { color: #ce9178; }
.schema-preview .number { color: #b5cea8; }
.schema-preview .boolean { color: #569cd6; }
.schema-preview .null { color: #569cd6; }
.schema-preview .key { color: #9cdcfe; }

/* ==================== REVIEW VARIANT SELECTOR ==================== */
.review-variant-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}
.review-variant-item {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.review-variant-item:hover {
    border-color: var(--schema);
}
.review-variant-item.selected {
    border-color: var(--schema);
    background: #f3e5f5;
}
.review-variant-icon {
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--schema);
}

/* ==================== ARRAY BUTTONS ==================== */
.array-add-btn {
    margin: 10px 0;
    padding: 8px 15px;
    background: white;
    border: 2px dashed var(--schema);
    border-radius: 8px;
    color: var(--schema);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}
.array-add-btn:hover {
    background: #f3e5f5;
}
.remove-item-btn {
    color: #dc3545;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
}
.remove-item-btn:hover {
    background: #ffebee;
}

/* ==================== NESTED OBJECTS ==================== */
.nested-object {
    margin-left: 20px;
    padding-left: 15px;
    border-left: 2px solid #ccc;
}
.schema-info-badge {
    background: #e8f0fe;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}
.primitive-field {
    background: #f9f9f9;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* ==================== CONSISTENCY TOGGLE ==================== */
.consistency-toggle {
    background: #f0f7ff;
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

/* ==================== LOADING OVERLAY TEXT ==================== */
#loadingOverlay div.text-center.text-white {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ==================== RESPONSIVE STYLES ==================== */
@media screen and (max-width: 769px) {
    .navbar > .container {
        justify-content: center !important;
    }
    .navbar-brand {
        text-align: center !important;
        margin: 0 !important;
        font-size: 1.5rem;
    }
    .navbar-text {
        text-align: center !important;
        margin: 0 !important;
    }
}