/* SQL Tester Container */
.sql-tester-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Tester Card - Full Width Container */
.tester-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.label-icon {
    font-size: 1rem;
}

.config-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
    cursor: pointer;
}

.config-select:hover {
    border-color: #9ca3af;
}

.config-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Workspace */
.tester-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 500px;
}

/* Workspace Panel */
.workspace-panel {
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

/* Query Configuration Panel */
.query-config-panel {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.panel-icon {
    font-size: 1.25rem;
}

.panel-action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-action-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.panel-action-btn .action-icon {
    font-size: 1rem;
}

.panel-action-btn .action-text {
    display: inline;
}

.panel-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
}

.status-indicator.active {
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-indicator.error {
    background: #ef4444;
}

.status-indicator.warning {
    background: #f59e0b;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* SQL Editor */
.sql-editor {
    flex: 1;
    min-height: 400px;
    
}

/* Results Container */
.results-container {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    max-height: 500px;
}

.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #9ca3af;
    text-align: center;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 0.9375rem;
    color: #6b7280;
}

/* Results Content */
.result-section {
    margin-bottom: 1.5rem;
}

.result-section:last-child {
    margin-bottom: 0;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #111827;
}

.result-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 3px solid;
    background: #f9fafb;
    font-size: 0.875rem;
    line-height: 1.5;
}

.result-item.error {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.result-item.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.result-item.success {
    border-left-color: #10b981;
    background: #f0fdf4;
    color: #065f46;
}

.result-item.info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.result-item-type {
    font-weight: 600;
    margin-right: 0.5rem;
}

.result-item-message {
    color: inherit;
}

/* Query Details */
.query-details {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.query-details-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #111827;
}

.query-details-content {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
}

.query-details-content strong {
    color: #111827;
}

.query-details-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.query-details-list li {
    padding: 0.375rem 0;
    color: #6b7280;
}

/* Action Buttons */
.tester-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.actions-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}

.actions-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
}

.primary-action-btn,
.secondary-action-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    justify-content: center;
}

.primary-action-btn {
    background: #3b82f6;
    color: #ffffff;
}

.primary-action-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.secondary-action-btn {
    background: #ffffff;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.secondary-action-btn:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

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

.btn-icon {
    font-size: 1.125rem;
}

/* Stats Panel */
.tester-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.75rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.stat-value.complexity-low {
    color: #10b981;
}

.stat-value.complexity-medium {
    color: #f59e0b;
}

.stat-value.complexity-high {
    color: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .tester-workspace {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .workspace-panel {
        min-height: 350px;
    }

    .sql-editor {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .sql-tester-container {
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .tester-card {
        padding: 1rem;
        gap: 1rem;
    }

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

    .query-config-panel {
        padding: 0.875rem 1rem;
    }

    .panel-header {
        padding: 0.875rem 1rem;
    }

    .tester-actions {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .actions-left,
    .actions-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .panel-action-btn .action-text {
        display: none;
    }

    .panel-action-btn {
        padding: 0.5rem;
        min-width: 36px;
        justify-content: center;
    }

    .primary-action-btn,
    .secondary-action-btn {
        width: 100%;
    }

    .tester-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-container {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .tester-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .query-config-panel {
        padding: 0.75rem;
    }

    .config-grid {
        gap: 0.75rem;
    }

    .config-label {
        font-size: 0.8125rem;
    }

    .config-select {
        padding: 0.5625rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Scrollbar Styling */
.results-container::-webkit-scrollbar {
    width: 8px;
}

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

.results-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
