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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

/* Navigation styles */
.main-nav {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

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

/* Main content */
main {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Service selection styles */
.service-selection h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.service-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.service-btn {
    display: flex;
    align-items: center;
    padding: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.service-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

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

.btn-icon {
    font-size: 3rem;
    margin-right: 20px;
    min-width: 80px;
    text-align: center;
}

.btn-text h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #333;
}

.btn-text p {
    color: #666;
    font-size: 0.95rem;
}

/* Form container styles */
.form-container {
    animation: fadeIn 0.3s ease-in;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.form-header h2 {
    color: #333;
    font-size: 1.8rem;
}

.back-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background: #5a6268;
}

/* Dynamic form styles */
.dynamic-form {
    max-width: 800px;
    margin: 0 auto;
}

/* Form section styles */
.form-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.section-header {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.section-header:before {
    content: '#';
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

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

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

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

.form-group select {
    cursor: pointer;
}

/* Form validation styles */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.error-message:before {
    content: '⚠️';
    margin-right: 5px;
}

/* Submit button styles */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Review button styles */
.review-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.review-btn:hover {
    background: linear-gradient(45deg, #218838, #1ba085);
}

/* Secondary button styles */
.btn-secondary {
    padding: 15px 30px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

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

/* Message styles */
.message-container {
    margin-top: 20px;
    animation: fadeIn 0.3s ease-in;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer styles */
footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.8;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

/* Confirmation styles */
.confirmation-container {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in;
}

.confirmation-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.confirmation-header h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

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

.confirmation-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.confirmation-section-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.confirmation-section-title:before {
    content: '#';
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
}

.confirmation-data-list {
    display: grid;
    gap: 12px;
}

.confirmation-data-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.2s ease;
}

.confirmation-data-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.confirmation-label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
}

.confirmation-value {
    color: #333;
    word-wrap: break-word;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

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

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    main {
        padding: 20px;
    }
    
    .service-buttons {
        grid-template-columns: 1fr;
    }
    
    .service-btn {
        padding: 20px;
    }
    
    .btn-icon {
        font-size: 2.5rem;
        margin-right: 15px;
        min-width: 60px;
    }
    
    .form-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .back-btn {
        order: -1;
        align-self: flex-start;
    }
    
    .confirmation-data-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .confirmation-label {
        font-size: 0.9rem;
    }
    
    .confirmation-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-secondary {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .main-nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Data Panel Styles */
.data-panel {
    animation: fadeIn 0.3s ease-in;
}

.data-header {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.data-header h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.data-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    align-items: center;
}

.search-input, .filter-select {
    padding: 10px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

.filter-select option {
    background: #333;
    color: white;
}

.data-stats {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    color: #666;
}

.data-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.data-item-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-item-header h4 {
    font-size: 1.2rem;
    margin: 0;
}

.data-timestamp {
    font-size: 0.9rem;
    opacity: 0.9;
}

.data-item-content {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.data-field {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    font-size: 0.9rem;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-data h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

/* Admin Panel Styles */
.admin-panel {
    animation: fadeIn 0.3s ease-in;
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    border-radius: 12px;
}

.admin-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

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

.admin-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-section h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.form-config-editor label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.config-editor {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    background: #f8f9fa;
    resize: vertical;
    min-height: 300px;
}

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

.admin-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: flex-end;
}

.backup-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Visual Form Builder Styles */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.admin-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.admin-tab-btn:hover {
    background: rgba(102, 126, 234, 0.05);
}

.service-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.service-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.visual-form-builder {
    max-height: 500px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-editor {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-header-editor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header-editor h4 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.section-title-editor {
    margin-bottom: 15px;
}

.section-title-editor label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.fields-container {
    border: 1px dashed #ccc;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fafafa;
}

.field-editor {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

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

.field-header h5 {
    margin: 0;
    color: #555;
    font-size: 1rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.field-col label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.visual-editor-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn-danger {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.3s ease;
}

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

.add-field {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .data-controls {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .data-item-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .data-item-content {
        flex-direction: column;
    }
    
    .admin-actions, .backup-actions {
        flex-direction: column;
    }
    
    .admin-actions button, .backup-actions button {
        width: 100%;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .field-row {
        grid-template-columns: 1fr;
    }
    
    .visual-editor-actions {
        flex-direction: column;
    }
    
    .section-header-editor {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .field-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .service-btn {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .data-field {
        font-size: 0.8rem;
    }
    
    .error-message {
        font-size: 0.8rem;
    }
}

/* Options Editor Styles */
.options-editor {
    margin-top: 15px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.options-editor h6 {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 1rem;
    font-weight: 600;
}

.options-container {
    margin-bottom: 15px;
}

.option-row {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.option-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.option-col label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.option-col input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.option-actions {
    display: flex;
    align-items: center;
}

.add-option {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.add-option:hover {
    background: #218838;
}

/* Responsive untuk options editor */
@media (max-width: 768px) {
    .option-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .option-actions {
        justify-content: center;
    }
}

/* ✅ BARU: Enhanced Admin Panel Styles */
.admin-stats-container {
    margin-bottom: 30px;
}

.admin-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

.admin-stats h4 {
    margin: 0 0 15px 0;
    color: #155724;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.stat-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #28a745;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 700;
    color: #333;
}

.stat-value.success {
    color: #28a745;
}

.stat-value.error {
    color: #dc3545;
}

/* ✅ Config Type Selector */
.config-type-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.config-type-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

/* ✅ Enhanced Visual Editor */
.visual-editor-header,
.json-editor-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.visual-editor-header h4,
.json-editor-header h4 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
}

.visual-editor-header p,
.json-editor-header p {
    margin: 0;
    opacity: 0.9;
}

/* ✅ Enhanced Field Editor */
.field-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-info h5 {
    margin: 0;
    font-size: 1rem;
}

.required-badge {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.common-field-selector {
    margin-bottom: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 6px;
    border-left: 3px solid #2196f3;
}

.common-field-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1565c0;
    font-size: 0.9rem;
}

.global-options-selector {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff3e0;
    border-radius: 6px;
    border-left: 3px solid #ff9800;
}

.global-options-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #f57c00;
    font-size: 0.9rem;
}

/* ✅ Enhanced Data Items */
.service-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-icon {
    font-size: 1.5rem;
}

.item-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.data-id {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Courier New', monospace;
}

.stats-text {
    flex: 1;
}

.stats-actions {
    display: flex;
    gap: 10px;
}

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

/* ✅ System Info */
.system-info {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

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

.info-label {
    font-weight: 600;
    color: #495057;
}

.info-value {
    color: #333;
}

/* ✅ Loading States */
.config-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* ✅ Data Management Actions */
.data-management-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .data-management-actions {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .item-meta {
        text-align: left;
    }

    .service-info {
        flex-direction: column;
        text-align: center;
    }

    .stats-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-secondary.small {
        width: 100%;
    }
}

/* ✅ Service Button Dynamic Colors */
.service-btn {
    border-color: var(--service-color);
}

.service-btn:hover {
    border-color: var(--service-color);
    box-shadow: 0 5px 15px rgba(var(--service-color-rgb, 102, 126, 234), 0.2);
}

.data-item {
    border-left-color: var(--service-color);
}

/* ✅ Visual Config Builder Styles */
.visual-config-builder {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.config-tabs {
    display: flex;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
}

.config-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.config-tab.active,
.config-tab:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.builder-workspace {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    min-height: 600px;
}

/* Component Library */
.component-library {
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
}

.component-library h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.1rem;
}

.component-group {
    margin-bottom: 25px;
}

.component-group h5 {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.95rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.draggable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all 0.3s ease;
}

.draggable-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.draggable-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.draggable-item .icon {
    font-size: 1.2rem;
}

.draggable-item .label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

/* Visual Editor Canvas */
.visual-editor-canvas {
    background: white;
    display: flex;
    flex-direction: column;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.canvas-header h4 {
    margin: 0;
    color: #333;
}

.canvas-controls {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

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

.canvas-content {
    flex: 1;
    padding: 20px;
    position: relative;
}

.drop-zone {
    min-height: 400px;
    border: 3px dashed #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.drop-placeholder {
    text-align: center;
    color: #999;
}

.drop-placeholder .drop-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.drop-placeholder .drop-text {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Properties Panel */
.properties-panel {
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
}

.properties-panel h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.1rem;
}

.no-selection {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-selection .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.live-preview {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.live-preview h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1rem;
}

.preview-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    min-height: 150px;
}

/* Builder Footer */
.builder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.validation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.validation-status.valid {
    color: #28a745;
}

.validation-status.invalid {
    color: #dc3545;
}

.builder-actions {
    display: flex;
    gap: 15px;
}

/* Feedback Notifications */
.feedback-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.feedback-notification.success {
    border-color: #28a745;
    background: #d4edda;
}

.feedback-notification.error {
    border-color: #dc3545;
    background: #f8d7da;
}

.feedback-notification.fade-out {
    animation: slideOutRight 0.3s ease;
}

/* Template Modal */
.config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.template-grid {
    display: grid;
    gap: 20px;
}

.template-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.template-card h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.template-card p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

/* Responsive */
@media (max-width: 1024px) {
    .builder-workspace {
        grid-template-columns: 200px 1fr 250px;
    }
}

@media (max-width: 768px) {
    .builder-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .component-library,
    .properties-panel {
        border: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .canvas-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .builder-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
