/* Prettify SQL Styles - Modern Professional Theme */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --border-radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

.prettify-sql-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.icon-wrapper {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    animation: float 3s ease-in-out infinite;
    position: relative;
}

.icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 28px;
    z-index: -1;
    opacity: 0.5;
    filter: blur(10px);
}

.icon-wrapper i {
    font-size: 3rem;
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.header-text {
    text-align: left;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.page-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
}

/* Converter Card */
.converter-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--gray-50);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.file-input {
    width: 100%;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--gray-300);
    padding: 1.25rem;
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: white;
    resize: vertical;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    min-height: 200px;
}

.file-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.file-info {
    margin-top: 1rem;
}

.file-info small {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* Action Section */
.action-section {
    text-align: center;
    margin: 2.5rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-convert {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.btn-convert::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-convert:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-convert:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-convert i {
    font-size: 1.4rem;
    position: relative;
    z-index: 1;
}

.btn-convert span {
    position: relative;
    z-index: 1;
}

.btn-clear {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-clear:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-2px);
}

.btn-clear i {
    font-size: 1.3rem;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin: 0;
    font-weight: 500;
}

/* Results Section */
.results-section {
    margin-top: 3rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--gray-200);
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--gray-50);
}

.result-content {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
}

.output-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--dark-color);
}

.btn-copy {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-copy:hover {
    background: var(--success-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.btn-copy.copied {
    background: var(--warning-color);
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.output-box {
    background: #1e1e1e;
    border-radius: var(--border-radius-sm);
    padding: 2rem;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-300);
}

.code-output {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Download Section */
.download-section {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--gray-200);
}

.btn-download {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
}

.btn-download:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-download i {
    font-size: 1.2rem;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1050;
    max-width: 420px;
}

.alert {
    padding: 1.25rem 1.75rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border-left: 4px solid #059669;
}

.alert-error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border-left: 4px solid #dc2626;
}

.alert i {
    font-size: 1.5rem;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: inherit;
    opacity: 0.8;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Info Section */
.info-section {
    margin-top: 4rem;
    animation: fadeInUp 0.8s ease-out;
}

.info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--gray-200);
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.info-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: var(--transition);
}

.info-card:hover .info-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.info-icon i {
    font-size: 2.25rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.info-card:hover .info-icon i {
    color: white;
    transform: scale(1.1);
}

.info-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.info-card p {
    color: var(--gray-600);
    line-height: 1.7;
    margin: 0;
    font-size: 1rem;
}

/* Examples Section */
.examples-section {
    margin-top: 4rem;
    padding: 3rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    animation: fadeInUp 1s ease-out;
}

.examples-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 2rem;
    text-align: center;
}

.example-btn {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-color);
}

.example-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.example-btn i {
    font-size: 1.5rem;
}

/* Scrollbar Styling */
.output-box::-webkit-scrollbar {
    width: 10px;
}

.output-box::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 5px;
}

.output-box::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 5px;
}

.output-box::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Responsive Design */
@media (max-width: 992px) {
    .prettify-sql-container {
        padding: 2rem 1rem;
    }

    .page-title {
        font-size: 2.25rem;
    }

    .converter-card {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-description {
        font-size: 1.1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .header-text {
        text-align: center;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .action-section {
        flex-direction: column;
    }

    .btn-convert,
    .btn-clear {
        width: 100%;
        justify-content: center;
    }

    .result-tabs {
        flex-direction: column;
        border-bottom: none;
        border-left: 3px solid var(--gray-200);
    }

    .tab-btn {
        width: 100%;
        justify-content: flex-start;
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 0;
        margin-left: -3px;
        border-radius: 0;
    }

    .tab-btn.active {
        border-bottom-color: transparent;
        border-left-color: var(--primary-color);
    }

    .output-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }

    .alert-container {
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .info-card {
        margin-bottom: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .upload-section,
    .action-section,
    .download-section,
    .info-section,
    .examples-section,
    .btn-copy,
    .alert-container {
        display: none;
    }

    .converter-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }

    .prettify-sql-container {
        background: white;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
button:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}
