/* SQL Formatter Plugin - Estilos */
.sql-formatter-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 30px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.sql-formatter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.sql-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.sql-header h2 {
    color: #343a40;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.sql-header p {
    color: #495057;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 30px;
}

/* Sistema de Abas */
.tab-navigation {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-button {
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.tab-button.active {
    background: #343a40;
    color: #fff;
}

.tab-content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Seções de conteúdo */
.converter-section,
.formatter-section {
    margin-bottom: 30px;
}

.converter-section h3,
.formatter-section h3 {
    color: #495057;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Campos de entrada SQL */
.sql-input,
.sql-output,
.sql-output-formatted {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    color: #212529;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

.sql-input:focus,
.sql-output:focus,
.sql-output-formatted:focus {
    border-color: #adb5bd;
    outline: none;
    box-shadow: 0 0 0 3px rgba(173, 181, 189, 0.2);
}

.sql-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Opções de formatação */
.formatting-options {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.formatting-options h4 {
    color: #343a40;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.option-item {
    background: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.option-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-item span {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Botões de ação */
.form-actions {
    text-align: center;
    margin: 30px 0;
}

.action-button {
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.action-button.primary {
    background: #495057;
    color: white;
}

.action-button.primary:hover {
    background: #343a40;
}

.action-button.secondary {
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

.action-button.secondary:hover {
    background: #dee2e6;
}

.action-button.small {
    padding: 8px 15px;
    font-size: 0.9rem;
    margin: 5px;
}

/* Loading state */
.action-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.action-button.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Notificações */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    max-width: 90%;
    word-break: break-word;
    color: #495057;
}

.notification.success {
    background: #f8f9fa;
    border-left: 4px solid #495057;
}

.notification.error {
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
}

.notification.warning {
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
}

.notification.info {
    background: #f8f9fa;
    border-left: 4px solid #0dcaf0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Seções de resultado */
.result-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(45deg, #f8f9fa, #ffffff);
    border-radius: 15px;
    border: 3px solid #28a745;
    position: relative;
}

.result-section::before {
    content: '✨';
    position: absolute;
    top: -15px;
    left: 20px;
    background: #28a745;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1.2rem;
}

.result-section h3 {
    color: #28a745;
    margin-bottom: 20px;
    font-size: 1.4rem;
    margin-left: 20px;
}

.result-container {
    position: relative;
}

.output-actions {
    margin-top: 15px;
    text-align: right;
}

/* Colorização de sintaxe SQL */
.sql-keyword {
    color: #495057;
    font-weight: bold;
}

.sql-string {
    color: #2c786c;
}

.sql-number {
    color: #004170;
}

.sql-comment {
    color: #6c757d;
    font-style: italic;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #dee2e6;
    border-top: 4px solid #495057;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    margin-top: 15px;
    color: #495057;
}

/* Seção de ajuda */
.help-section {
    margin-top: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.help-section details {
    padding: 20px;
}

.help-section summary {
    color: #343a40;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.help-content {
    margin-top: 15px;
    color: #495057;
}

.help-content h4 {
    color: #ffd700;
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-content ul {
    margin: 10px 0 10px 20px;
}

.help-content li {
    margin-bottom: 8px;
}

.help-content code {
    background: #e9ecef;
    color: #212529;
    padding: 10px;
    border-radius: 5px;
    display: block;
    margin: 10px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    border: 1px solid #dee2e6;
}

/* Responsividade */
@media (max-width: 768px) {
    .sql-formatter-container {
        padding: 15px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .sql-header h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .sql-header p {
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .tab-button {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .formatting-options {
        padding: 15px;
        margin: 15px 0;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .option-item {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-button {
        width: 100%;
        margin: 0;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .sql-input,
    .sql-output,
    .sql-output-formatted {
        min-height: 150px;
        font-size: 14px;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .output-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .output-actions .action-button {
        width: 100%;
    }
    
    .help-section {
        margin-top: 20px;
    }
    
    .help-section details {
        padding: 15px;
    }
    
    .help-section summary {
        font-size: 1rem;
    }
    
    .help-content {
        font-size: 0.9rem;
    }
    
    .help-content code {
        font-size: 0.8rem;
        padding: 8px;
        margin: 8px 0;
    }
}

@media (max-width: 480px) {
    .sql-formatter-container {
        padding: 10px;
        margin: 5px;
    }
    
    .sql-header h2 {
        font-size: 1.5rem;
    }
    
    .sql-header p {
        font-size: 0.8rem;
    }
    
    .tab-button {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .action-button {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .sql-input,
    .sql-output,
    .sql-output-formatted {
        font-size: 13px;
        padding: 10px;
    }
    
    .help-content {
        font-size: 0.8rem;
    }
}

/* Animações adicionais */
.sql-input,
.sql-output,
.sql-output-formatted {
    transition: all 0.3s ease;
}

.sql-input:hover,
.sql-output:hover,
.sql-output-formatted:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.result-section {
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar customizada */
.sql-input::-webkit-scrollbar,
.sql-output::-webkit-scrollbar,
.sql-output-formatted::-webkit-scrollbar {
    width: 8px;
}

.sql-input::-webkit-scrollbar-track,
.sql-output::-webkit-scrollbar-track,
.sql-output-formatted::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sql-input::-webkit-scrollbar-thumb,
.sql-output::-webkit-scrollbar-thumb,
.sql-output-formatted::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.sql-input::-webkit-scrollbar-thumb:hover,
.sql-output::-webkit-scrollbar-thumb:hover,
.sql-output-formatted::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
} 