/* Table Generator Section */
.table-generator-section {
    margin-top: 2rem;
}

.tool-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Panel Styles */
.config-panel,
.output-panel,
.preview-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.config-panel:hover,
.output-panel:hover,
.preview-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.config-panel .panel-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.preview-panel .panel-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.panel-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.panel-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 4px 0 0 0;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Config Content */
.config-content {
    padding: 24px;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.label-text {
    flex: 1;
}

.label-value {
    font-weight: 600;
    color: #667eea;
    font-size: 13px;
    background: #f0f4ff;
    padding: 4px 10px;
    border-radius: 6px;
}

.form-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

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

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.check-label {
    flex: 1;
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: #ffffff;
    transform: translateY(-2px);
}

.btn i {
    font-size: 14px;
}

/* Editor Container */
.editor-container {
    padding: 0;
    position: relative;
}

.editor {
    width: 100%;
    height: 100%;
}

#html-output {
    font-size: 14px;
    line-height: 1.6;
}

/* Preview Panel */
.preview-panel {
    margin-top: 24px;
}

.preview-container {
    padding: 24px;
    min-height: 200px;
    background: #f8f9fa;
    overflow-x: auto;
}

.table-preview {
    width: 100%;
    overflow-x: auto;
}

.table-preview table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.table-preview th,
.table-preview td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e9ecef;
}

.table-preview th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
}

.table-preview tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table-preview tr:hover {
    background-color: #e9ecef;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .tool-wrapper {
        grid-template-columns: 1fr;
    }

    .editor-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .table-generator-section {
        margin-top: 1.5rem;
    }

    .tool-wrapper {
        gap: 16px;
        margin-bottom: 16px;
    }

    .panel-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .config-content {
        padding: 20px;
    }

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

    .button-group {
        margin-top: 24px;
        padding-top: 20px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .editor-container {
        height: 350px;
    }

    .preview-container {
        padding: 16px;
    }

    .table-preview th,
    .table-preview td {
        padding: 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .panel-title {
        font-size: 18px;
    }

    .panel-subtitle {
        font-size: 12px;
    }

    .config-content {
        padding: 16px;
    }

    .form-label {
        font-size: 13px;
    }

    .label-value {
        font-size: 12px;
        padding: 3px 8px;
    }

    .editor-container {
        height: 300px;
    }

    #html-output {
        font-size: 12px;
    }
}

/* Loading and Success States */
.btn-copy.copied {
    background: #28a745;
    color: #ffffff;
}

.btn-copy.copied::after {
    content: " ✓";
}

/* Empty State */
.preview-container:empty::before {
    content: "Generate a table to see the preview";
    display: block;
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

/* Scrollbar Styling */
.preview-container::-webkit-scrollbar,
.editor-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.preview-container::-webkit-scrollbar-track,
.editor-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb,
.editor-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb:hover,
.editor-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

