:root {
    /* Primary Colors */
    --sql-primary: #7c3aed;
    --sql-primary-dark: #6d28d9;
    --sql-primary-light: #ede9fe;
    --sql-primary-hover: #6d28d9;
    --sql-primary-shadow: rgb(124 58 237 / 25%);
    
    /* Semantic Colors */
    --sql-success: #10b981;
    --sql-warning: #f59e0b;
    --sql-danger: #ef4444;
    --sql-info: #8b5cf6;
    --sql-accent: #a78bfa;
    
    /* Surface Colors */
    --sql-surface: #ffffff;
    --sql-surface-muted: #f5f3ff;
    --sql-surface-elevated: #ffffff;
    --sql-background: #faf5ff;
    --sql-secondary-bg: #f3e8ff;
    
    /* Border Colors */
    --sql-border: #e9d5ff;
    --sql-border-light: #f3e8ff;
    --sql-border-dark: #ddd6fe;
    
    /* Text Colors */
    --sql-text-main: #0f172a;
    --sql-text-muted: #64748b;
    --sql-text-light: #94a3b8;
    --sql-text-inverse: #ffffff;
    
    /* Shadow System */
    --sql-shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --sql-shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --sql-shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --sql-shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --sql-shadow-xl: 0 20px 25px rgb(15 23 42 / 0.1);
    
    /* Border Radius */
    --sql-radius-sm: 0.375rem;
    --sql-radius-md: 0.75rem;
    --sql-radius-lg: 1.5rem;
    --sql-radius-xl: 2rem;
    --sql-radius-full: 9999px;
    
    /* Spacing */
    --sql-spacing-xs: 0.25rem;
    --sql-spacing-sm: 0.5rem;
    --sql-spacing-md: 1rem;
    --sql-spacing-lg: 1.5rem;
    --sql-spacing-xl: 2rem;
    
    /* Legacy Variables */
    --primary-color: var(--sql-primary);
    --primary-color-light: var(--sql-primary-light);
    --surface-color: var(--sql-surface);
    --light-bg: var(--sql-background);
    --border-color: var(--sql-border);
    --text-primary: var(--sql-text-main);
    --text-secondary: var(--sql-text-muted);
    --secondary-color: var(--sql-text-muted);
    --success-color: var(--sql-success);
    --info-color: var(--sql-info);
    --warning-color: var(--sql-warning);
    --danger-color: var(--sql-danger);
    --dark-text: var(--sql-text-main);
    --border-radius: var(--sql-radius-lg);
    --shadow: var(--sql-shadow-md);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* related to and faqs component variables */
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --border: #e9d5ff;
    --surface: #ffffff;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --surface-muted: #f5f3ff;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

.sql-converter-page {
    padding-bottom: 2rem;
}

.sql-intro {
    margin-bottom: 2rem;
}

.sql-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-text);
    line-height: 1.2;
}

.sql-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    max-width: 760px;
    line-height: 1.6;
}

.sql-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    list-style: none;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    color: var(--dark-text);
}

.sql-main {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--sql-shadow-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    padding: 2rem;
}

@media (max-width: 991px) {
    .sql-main {
        padding: 1.5rem;
    }
}

.sql-card {
    padding: 0;
}

.sql-form {
    max-width: 100%;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--dark-text);
}

.status-bar svg {
    flex-shrink: 0;
    color: var(--info-color);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 0.9375rem;
}

.label-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-trigger {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--info-color);
    color: white;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
    line-height: 1;
}

.tooltip-trigger:hover {
    background: var(--sql-primary-dark);
    transform: scale(1.1);
}

.tooltip-trigger:focus {
    outline: 2px solid var(--sql-primary);
    outline-offset: 2px;
}

.tooltiptext {
    visibility: hidden;
    opacity: 0;
    width: 240px;
    background-color: var(--sql-text-main);
    color: var(--sql-text-inverse);
    text-align: left;
    border-radius: 8px;
    padding: 0.75rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -120px;
    font-size: 0.8125rem;
    line-height: 1.5;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--sql-text-main) transparent transparent transparent;
}

.tooltip:hover .tooltiptext,
.tooltip-trigger:focus + .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.editor-wrapper {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    height: 300px;
    min-height: 300px;
    transition: var(--transition);
    position: relative;
    width: 100%;
}

.editor-wrapper:focus-within {
    border-color: var(--sql-primary);
    box-shadow: 0 0 0 3px var(--sql-primary-shadow);
}

.editor-wrapper .editor {
    height: 300px !important;
    width: 100% !important;
    min-height: 300px;
}

@media (max-width: 767px) {
    .editor-wrapper {
        height: 250px;
        min-height: 250px;
    }
    
    .editor-wrapper .editor {
        height: 250px !important;
        min-height: 250px;
    }
}

.sql-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9375rem;
    background: var(--sql-surface);
    color: var(--sql-text-main);
    transition: var(--transition);
    
}

.sql-input:focus {
    outline: none;
    border-color: var(--sql-primary);
    box-shadow: 0 0 0 3px var(--sql-primary-shadow);
}

.sql-input:invalid {
    border-color: var(--sql-danger);
}

.sql-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9375rem;
    background: var(--sql-surface);
    color: var(--sql-text-main);
    cursor: pointer;
    transition: var(--transition);
    
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.sql-select:focus {
    outline: none;
    border-color: var(--sql-primary);
    box-shadow: 0 0 0 3px var(--sql-primary-shadow);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.convert-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.875rem 1.5rem;
    background: var(--sql-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.convert-btn:hover {
    background: var(--sql-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--sql-shadow-md);
}

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

.convert-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--sql-primary-shadow);
}

.ghost-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: var(--sql-text-main);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ghost-btn:hover {
    background: var(--light-bg);
    border-color: var(--sql-primary);
    color: var(--sql-primary);
}

.ghost-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--sql-primary-shadow);
}

.results-container {
    background: var(--sql-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--sql-shadow-md);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sql-text-main);
    margin: 0;
}

.results-stats {
    font-size: 0.875rem;
    color: var(--sql-text-muted);
    background: var(--light-bg);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
}

.result-content {
    flex: 1;
    min-height: 0;
    margin-bottom: 1rem;
}

.sql-preview-wrapper {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
    position: relative;
}

.sql-preview-wrapper .editor {
    height: 100% !important;
    width: 100% !important;
    min-height: 400px;
}

@media (max-width: 767px) {
    .sql-preview-wrapper {
        min-height: 300px;
    }
    
    .sql-preview-wrapper .editor {
        min-height: 300px;
    }
}

.result-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.action-buttons-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.action-button {
    flex: 1 1 auto;
    min-width: 120px;
    background: var(--light-bg);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.action-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.action-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--sql-primary-shadow);
}

.action-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.action-button svg {
    width: 16px;
    height: 16px;
}

.share-container {
    background: var(--light-bg);
    border-radius: var(--sql-radius-md);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.share-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
    color: #ffffff;
}

.share-x { background: #111827; }
.share-facebook { background: #1877f2; }
.share-linkedin { background: #0a66c2; }
.share-reddit { background: #ff4500; }
.share-telegram { background: #229ed9; }
.share-whatsapp { background: #25d366; color: #0f172a; }

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    min-height: 400px;
    color: var(--sql-text-muted);
}

.empty-state-icon {
    margin-bottom: 1rem;
    color: var(--sql-text-light);
}

.empty-state-content p {
    font-size: 0.9375rem;
    max-width: 400px;
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.invalid-feedback {
    display: none;
    color: var(--sql-danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.sql-input:invalid:not(:placeholder-shown) + .invalid-feedback {
    display: block;
}

/* Knowledge Section Styles */
.sql-knowledge {
    padding: 2rem 0;
}

.sql-article-card {
    background: var(--sql-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--sql-shadow-md);
    padding: 2.5rem;
    max-width: 100%;
}

@media (max-width: 767px) {
    .sql-article-card {
        padding: 1.5rem;
    }
}

.sql-card-header {
    margin-bottom: 2rem;
}

.sql-card-header h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--sql-text-main);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.sql-card-header p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--sql-text-muted);
    margin-bottom: 1rem;
}

.sql-card-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sql-instruction-section,
.sql-example-section,
.sql-audience-section,
.sql-comparison-section,
.sql-guide-section,
.sql-mechanics-section,
.sql-boundaries-section,
.sql-credibility-section {
    margin-bottom: 1.5rem;
}

.sql-instruction-section h3,
.sql-example-section h3,
.sql-audience-section h3,
.sql-comparison-section h3,
.sql-guide-section h3,
.sql-mechanics-section h3,
.sql-boundaries-section h3,
.sql-credibility-section h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--sql-text-main);
    margin-bottom: 1rem;
}

.sql-steps-list {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.sql-steps-list li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: var(--sql-text-muted);
}

.sql-tip {
    padding: 1rem;
    background: var(--sql-primary-light);
    border-left: 4px solid var(--sql-primary);
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--sql-text-main);
}

.sql-example-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 12px;
}

.sql-example-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sql-text-main);
    margin-bottom: 0.75rem;
}

.sql-example-item p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--sql-text-muted);
    margin-bottom: 0.75rem;
}

.sql-code-sample {
    background: var(--sql-text-main);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.875rem;
    
    margin: 1rem 0;
    line-height: 1.6;
}

.sql-audience-list {
    list-style: none;
    padding: 0;
}

.sql-audience-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.7;
    color: var(--sql-text-muted);
}

.sql-audience-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--sql-primary);
    font-weight: 600;
}

.sql-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.sql-strengths-block,
.sql-limitations-block {
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 12px;
}

.sql-strengths-block h4,
.sql-limitations-block h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sql-text-main);
    margin-bottom: 0.75rem;
}

.sql-strengths-block ul,
.sql-limitations-block ul {
    list-style: none;
    padding: 0;
}

.sql-strengths-block ul li,
.sql-limitations-block ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
    color: var(--sql-text-muted);
    font-size: 0.9375rem;
}

.sql-strengths-block ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--sql-success);
    font-weight: 600;
}

.sql-limitations-block ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--sql-warning);
    font-weight: 600;
}

.sql-guide-list {
    list-style: none;
    padding: 0;
}

.sql-guide-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.7;
    color: var(--sql-text-muted);
    font-size: 0.9375rem;
}

.sql-guide-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--sql-primary);
    font-weight: 600;
}

.sql-guide-list a {
    color: var(--sql-primary);
    text-decoration: none;
    font-weight: 500;
}

.sql-guide-list a:hover {
    text-decoration: underline;
}

.sql-mechanics-section p,
.sql-boundaries-section ul {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--sql-text-muted);
}

.sql-boundaries-list {
    list-style: none;
    padding: 0;
}

.sql-boundaries-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.7;
    color: var(--sql-text-muted);
}

.sql-boundaries-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--sql-info);
    font-weight: 600;
}

.sql-credibility-section p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--sql-text-muted);
    margin-bottom: 0.75rem;
}

.sql-credibility-section a {
    color: var(--sql-primary);
    text-decoration: none;
    font-weight: 500;
}

.sql-credibility-section a:hover {
    text-decoration: underline;
}

.sql-credibility-note {
    padding: 1rem;
    background: var(--sql-primary-light);
    border-left: 4px solid var(--sql-primary);
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: var(--sql-text-main);
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .sql-main {
        padding: 1.5rem;
    }
    
    .results-container {
        margin-top: 1.5rem;
    }
}

@media (max-width: 767px) {
    .form-actions {
        flex-direction: column;
    }
    
    .convert-btn,
    .ghost-btn {
        width: 100%;
    }
    
    .action-buttons-row {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .sql-comparison-grid {
        grid-template-columns: 1fr;
    }
}

