@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
}

:root {
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --secondary-color: #1e40af;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f0f9ff;
    --background-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #dbeafe;
    --shadow-sm: 0 1px 3px 0 rgba(59, 130, 246, 0.1), 0 1px 2px 0 rgba(59, 130, 246, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(59, 130, 246, 0.1), 0 4px 6px -2px rgba(59, 130, 246, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 10px 10px -5px rgba(59, 130, 246, 0.04);
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

* {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--background-gradient);
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
    margin-bottom: 60px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.08"><circle cx="30" cy="30" r="1.5"/></g></svg>');
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.result-section {
    flex: 2;
}

.result-box {
    background: var(--card-bg);
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    min-height: 300px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    width: 100%;
}

.result-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    text-align: center;
    width: 100%;
    padding: 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    font-weight: 400;
}

.main-content-wrapper {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin: 0 auto;
}

.upload-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 4rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    flex: 1;
    margin: 0;
    height: 100%;
    overflow-y: auto;
}

.upload-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.upload-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    margin: 0 auto 2rem auto;
    max-width: 1200px;
    width: 100%;
}

.upload-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.form-selection-wrapper,
.text-input-wrapper {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Vazirmatn';
    font-size: 1rem;
    background-color: white;
    color: var(--text-color);
    transition: all var(--transition-fast);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.form-select:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow-md);
}

.form-select:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-select.loading {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.text-input {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Vazirmatn';
    font-size: 1rem;
    background-color: white;
    color: var(--text-color);
    transition: all var(--transition-fast);
    resize: vertical;
    box-shadow: var(--shadow-sm);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.text-input:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow-md);
}

.text-input:invalid {
    border-color: var(--error-color);
}

.text-input:valid {
    border-color: var(--success-color);
}

/* Character counter */
.text-input-wrapper {
    position: relative;
}

.char-counter {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.char-counter.warning {
    color: var(--warning-color);
}

.char-counter.error {
    color: var(--error-color);
}

.file-input-wrapper {
    margin-bottom: 0.5rem;
    position: relative;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    border: 1px solid transparent;
}

.file-label:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.file-label::before {
    content: '';
}

.file-label.drag-over {
    background: linear-gradient(135deg, var(--success-color) 0%, #15803d 100%);
    border-color: var(--success-color);
    transform: scale(1.02);
}

#fileInput {
    display: none;
}

.file-name {
    margin-right: 1rem;
    color: #666;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.file-name::before {
    content: '';
}

.file-name.success {
    background: #f0fdf4;
    border-color: var(--success-color);
    color: var(--success-color);
}

.file-name.error {
    background: #fef2f2;
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Upload area with new design */
.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(29, 78, 216, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

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

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
    border-color: var(--secondary-color);
    transform: scale(1.02);
}

.upload-area.highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.15) 100%);
    border-color: var(--success-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.upload-area i {
    font-size: 4rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    display: block;
}

.upload-area p {
    color: var(--text-muted);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Drag and drop zone */
.drag-drop-zone {
    border: 3px dashed var(--primary-color);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(29, 78, 216, 0.05) 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

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

.drag-drop-zone:hover::before {
    left: 100%;
}

.drag-drop-zone:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
    border-color: var(--secondary-color);
    transform: scale(1.02);
}

.drag-drop-zone.drag-over {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.15) 100%);
    border-color: var(--success-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    transform: scale(1.02);
}

.drag-drop-zone .drag-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.drag-drop-zone .drag-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 0.75rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

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

.submit-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.75rem 2.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Vazirmatn';
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
}

.submit-btn::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;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
    opacity: 0.7;
}

.submit-btn.loading {
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Button variants */
.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(5px);
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
    border: 2px solid var(--text-muted);
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(5px);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
}

.btn-outline-secondary:hover {
    background: var(--text-muted);
    border-color: var(--text-muted);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--text-muted);
    color: var(--text-color) !important;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.25);
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Vazirmatn';
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.secondary-btn:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 4rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.result-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-height: 300px;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.result-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.result-text {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 1.5rem;
    white-space: pre-line;
    direction: rtl;
    text-align: right;
    font-size: 1.1rem;
    line-height: 1.8;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.json-result {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    direction: rtl;
    text-align: right;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.result-items {
    direction: rtl;
    text-align: right;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.file-item {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    max-height: 100px;
    overflow: hidden;
}

.file-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
}

.file-item i {
    margin-left: 0.75rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.file-item span {
    font-weight: 500;
    color: var(--text-color);
}

.file-item button {
    color: var(--error-color);
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.file-item button:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error-color);
    transform: scale(1.1);
    color: #dc2626;
}

.file-item button i {
    margin: 0 !important;
    font-size: 0.9rem;
}

.result-item {
    margin-bottom: 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(29, 78, 216, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
    break-inside: avoid;
    height: fit-content;
    box-shadow: var(--shadow-sm);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    backdrop-filter: blur(5px);
}

.result-item:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.result-field-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    text-align: right;
    direction: rtl;
    padding: 0.5rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 6px;
    border-right: 3px solid var(--primary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.result-field-value {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    text-align: right;
    direction: rtl;
    line-height: 1.6;
    color: var(--text-color);
    min-height: 3rem;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.result-field-value:empty::before {
    content: 'خالی';
    color: #9ca3af;
    font-style: italic;
}

.result-section h2 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    text-align: center;
    font-weight: bold;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* Form-based Result Display */
.form-result {
    display: none;
}

.form-result.show {
    display: block;
}

.form-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
    max-width: 1600px;
    margin: 0 auto;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid var(--primary-color);
}

.form-field-value {
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
    min-height: 2.5rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.form-field-value:empty::before {
    content: 'اطلاعاتی یافت نشد';
    color: #9ca3af;
    font-style: italic;
}

.form-field-value.has-content {
    background: #f0f9ff;
    border-color: #0ea5e9;
    border-left: 4px solid #0ea5e9;
}

.form-field-value.has-content::before {
    content: none;
}

.form-field-value.empty-field {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    border-style: dashed;
}

.form-field-value.empty-field::before {
    content: 'در انتظار پردازش...';
    color: #9ca3af;
    font-style: italic;
}

.form-field-value.filling-animation {
    animation: fieldFill 0.6s ease-out forwards;
    border-color: #10b981;
    border-left: 4px solid #10b981;
}

@keyframes fieldFill {
    0% {
        background-color: #f9fafb;
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        background-color: #ecfdf5;
        transform: scale(1.02);
        opacity: 1;
    }
    100% {
        background-color: #f0f9ff;
        transform: scale(1);
        opacity: 1;
    }
}

/* Management Section */
.management-section {
    margin-top: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.management-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    text-align: center;
    font-weight: bold;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.management-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.structure-list,
.create-structure {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.structure-list h3,
.create-structure h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.structures-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.structure-item {
    background: white;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.structure-item:hover {
    background: #f0f9ff;
    border-color: var(--primary-color);
}

.structure-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.structure-meta {
    font-size: 0.85rem;
    color: #666;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Vazirmatn';
    font-size: 1rem;
    background-color: white;
    color: var(--text-color);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* Enhanced Message Boxes */
.alert {
    border: none;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
    color: var(--text-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    color: var(--text-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.15) 100%);
    color: var(--text-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.error-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    color: var(--text-color);
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.error-box::before {
    content: 'خطا';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
    background: var(--error-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.success-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    color: var(--text-color);
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.success-box::before {
    content: 'موفق';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.warning-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    color: var(--text-color);
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.warning-box::before {
    content: 'هشدار';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
    background: var(--warning-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.info-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.15) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    color: var(--text-color);
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.info-box::before {
    content: 'اطلاع';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.8rem;
    font-weight: bold;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay .spinner-border {
    width: 4rem;
    height: 4rem;
    border-width: 0.3em;
}

.loading-overlay p {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 1.5rem;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.loading-structures {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* Enhanced Loading States */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-button {
    height: 2.5rem;
    width: 8rem;
    border-radius: 4px;
}

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

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.upload-container,
.result-card {
    animation: fadeInUp 0.6s ease;
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Slide In Animation */
@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0, -8px, 0); }
    70% { transform: translate3d(0, -4px, 0); }
    90% { transform: translate3d(0, -2px, 0); }
}

.bounce {
    animation: bounce 1s infinite;
}

.hidden {
    display: none;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    font-size: 0.9rem;
    gap: 5px;
}

.footer-prefix {
    color: var(--text-color);
}

.company-name {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.footer-company {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.ocr-text {
    white-space: pre-wrap;
    text-align: right;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: 'Vazirmatn', sans-serif;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Ensure text visibility in alerts */
.alert h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.alert h5 {
    color: var(--text-color);
    font-weight: 500;
}

/* Modal button improvements */
.modal .btn-secondary {
    background: var(--text-muted);
    border-color: var(--text-muted);
    color: white;
}

.modal .btn-secondary:hover {
    background: var(--text-color);
    border-color: var(--text-color);
    color: white;
}

/* Ensure all buttons in results and modals are visible */
.result-card .btn,
.alert .btn,
.modal .btn {
    min-height: 38px;
    font-weight: 600;
    text-decoration: none !important;
}

.result-card .btn-outline-primary,
.alert .btn-outline-primary {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2) !important;
}

.result-card .btn-outline-primary:hover,
.alert .btn-outline-primary:hover {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.result-card .btn-outline-secondary,
.alert .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 2px solid var(--text-muted) !important;
    color: var(--text-color) !important;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2) !important;
}

.result-card .btn-outline-secondary:hover,
.alert .btn-outline-secondary:hover {
    background: var(--text-muted) !important;
    color: white !important;
    border-color: var(--text-muted) !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    pointer-events: none;
}

.toast-notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 50px;
    padding: 1rem 2rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 500px;
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: top right;
    position: relative;
    overflow: hidden;
}

.toast-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: toastShimmer 2s infinite;
}

.toast-notification.success {
    border-left: 4px solid var(--success-color);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.toast-notification.error {
    border-left: 4px solid var(--error-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
}

.toast-notification.info {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
}

.toast-notification.warning {
    border-left: 4px solid var(--warning-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    direction: rtl;
    text-align: right;
    width: 100%;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.toast-icon.success {
    background: var(--success-color);
    color: white;
}

.toast-icon.error {
    background: var(--error-color);
    color: white;
}

.toast-icon.info {
    background: var(--primary-color);
    color: white;
}

.toast-icon.warning {
    background: var(--warning-color);
    color: white;
}

.toast-text {
    flex: 1;
    font-family: 'Vazirmatn', sans-serif;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

/* Toast Animations */
@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -100%) scale(0.3);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -20%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

@keyframes toastShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.toast-notification.removing {
    animation: toastSlideOut 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -20%) scale(0.95);
    }
}

/* Toast bubble effect */
.toast-notification::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    filter: blur(2px);
}

/* Responsive toasts */
@media (max-width: 768px) {
    .toast-notification {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        padding: 0.875rem 1.5rem;
        margin: 0 20px 0.75rem 20px;
    }

    .toast-content {
        font-size: 0.9rem;
    }

    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Button container utilities */
.d-flex.gap-2 > * + * {
    margin-right: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.2rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .container {
        padding: 0 1rem;
        margin: 0;
        max-width: 100%;
    }

    .upload-container {
        padding: 2rem;
        margin: 0;
        max-width: 100%;
    }

    .upload-box {
        padding: 1.5rem;
        margin: 0 0 2rem 0;
        max-width: 100%;
    }

    .upload-area {
        padding: 2.5rem 1rem;
    }

    .upload-area i {
        font-size: 3rem;
    }

    .btn-primary {
        padding: 0.6rem 2rem;
        font-size: 1rem;
    }

    .submit-btn {
        padding: 0.6rem 2rem;
        font-size: 1rem;
    }

    .main-content-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .result-section {
        max-width: 100%;
        margin: 0;
    }

    .result-card {
        padding: 2rem;
        margin: 1rem 0;
        max-width: 100%;
        overflow-y: auto;
    }

    .result-box {
        padding: 1.5rem;
        margin: 1rem 0;
        max-width: 100%;
    }

    .management-section {
        max-width: 100%;
        margin: 3rem 0;
        padding: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .result-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .content-wrapper {
        gap: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .management-box {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .result-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Dynamic Fields Interface */
.fields-container {
    margin-bottom: 1rem;
}

.field-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.2s ease;
}

.field-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.field-item.focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.field-number {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.remove-field-btn {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

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

.field-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-input-group {
    display: flex;
    flex-direction: column;
}

.field-input-group label {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.field-input-group input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Vazirmatn';
    font-size: 1rem;
    transition: border-color 0.2s;
}

.field-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-field-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Vazirmatn';
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-field-btn:hover {
    background-color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.2);
}

.json-preview {
    margin-top: 1.5rem;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
}

.json-preview label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.json-preview-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 200px;
    overflow-y: auto;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
}


/* Medium screens - 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
    .form-fields {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

/* Responsive adjustments for field interface */
@media (max-width: 768px) {
    .field-inputs {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .field-item {
        padding: 0.75rem;
    }
    
    .add-field-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .json-preview-content {
        font-size: 0.8rem;
        max-height: 150px;
    }
    
    .result-section {
        margin-top: 1rem;
    }
    
    .result-items {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .result-item {
        padding: 0.75rem;
    }
    
    .result-field-name {
        font-size: 0.95rem;
        padding: 0.4rem;
    }
    
    .result-field-value {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .result-box {
        min-height: 400px;
        padding: 1rem;
    }
    
    .form-fields {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .container {
        padding: 0 0.25rem;
        max-width: 100%;
    }

    .management-box {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .upload-container,
    .upload-box {
        margin: 0;
        max-width: 100%;
    }

    .result-card,
    .result-box {
        margin: 0;
        max-width: 100%;
    }

    .management-section {
        margin: 2rem 0;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .field-item {
        padding: 0.5rem;
    }

    .field-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .add-field-btn {
        width: 100%;
        justify-content: center;
    }

    .result-items {
        gap: 0.5rem;
    }

    .result-item {
        padding: 0.5rem;
    }

    .container {
        margin: 1rem 0;
        padding: 0 0.25rem;
        max-width: 100%;
    }

    .upload-container,
    .upload-box,
    .management-section {
        padding: 1rem;
        margin: 0;
        max-width: 100%;
    }

    .result-card,
    .result-box {
        padding: 1rem;
        margin: 0.5rem 0;
        max-width: 100%;
    }
}