/* Global Styles */
* {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Header Styles */
.header-main {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #6366f1 100%);
    color: white;
    padding: 3rem 1rem;
    text-align: center;
}

.dark .header-main {
    background: linear-gradient(135deg, #1e3a8a 0%, #5b21b6 50%, #3730a3 100%);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.header-text {
    flex: 1;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .header-title {
        font-size: 3rem;
        justify-content: flex-start;
    }
}

.header-icon {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.header-text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #dbeafe;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .header-description {
        font-size: 1.25rem;
        margin: 0;
    }
}

.theme-toggle-button {
    flex-shrink: 0;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-icon {
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.5s ease;
}

.theme-toggle-button:hover .theme-icon {
    transform: rotate(180deg);
}

.header-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 60px;
}

.header-wave::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.dark .header-wave::before {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.dark .btn-secondary {
    background-color: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark .btn-secondary:hover {
    background-color: #4b5563;
}

/* Feature Cards */
.feature-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.dark .feature-card {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.feature-highlight {
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    text-align: center;
}

.dark .feature-highlight {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
}

.feature-highlight:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.dark .form-label {
    color: #d1d5db;
}

.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    outline: none;
}

.dark .form-select {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Editor Panels */
.editor-panel {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.dark .editor-panel {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-color: #374151;
}

.editor-panel:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
}

.dark .editor-header {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-bottom-color: #4b5563;
}

.editor-info {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.dark .editor-info {
    color: #9ca3af;
}

.editor-body {
    position: relative;
}

.editor-textarea {
    width: 100%;
    min-height: 24rem;
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background-color: #ffffff;
    color: #1f2937;
    border: none;
    outline: none;
    resize: vertical;
    transition: background-color 0.2s ease;
}

.dark .editor-textarea {
    background-color: #1f2937;
    color: #f3f4f6;
}

.editor-textarea:focus {
    background-color: #fafbfc;
}

.dark .editor-textarea:focus {
    background-color: #111827;
}

.editor-textarea::placeholder {
    color: #9ca3af;
}

.dark .editor-textarea::placeholder {
    color: #6b7280;
}

/* Error Message */
.error-message {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    font-size: 0.875rem;
    border-top: 1px solid #fecaca;
}

.dark .error-message {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    color: #fecaca;
    border-top-color: #991b1b;
}

.error-message::before {
    content: '⚠️ ';
    margin-right: 0.5rem;
}

/* Tabular Preview */
.table-preview {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-preview th,
.table-preview td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.dark .table-preview th,
.dark .table-preview td {
    border-color: #4b5563;
}

.table-preview th {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.dark .table-preview th {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #d1d5db;
}

.table-preview tbody tr {
    transition: background-color 0.2s ease;
}

.table-preview tbody tr:hover {
    background-color: #f9fafb;
}

.dark .table-preview tbody tr:hover {
    background-color: #374151;
}

/* Metric Cards */
.metric-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all 0.3s ease;
}

.dark .metric-card {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.dark .metric-label {
    color: #9ca3af;
}

.metric-value {
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* FAQ Styles */
.faq-item {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.dark .faq-item {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
}

.faq-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.faq-question {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.125rem;
    color: #1f2937;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dark .faq-question {
    color: #f3f4f6;
}

.faq-question::before {
    content: '▶';
    color: #3b82f6;
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

.faq-item[open] .faq-question::before {
    transform: rotate(90deg);
}

.faq-answer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    line-height: 1.7;
}

.dark .faq-answer {
    border-top-color: #4b5563;
    color: #9ca3af;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wave-bottom::before {
        height: 40px;
    }
    
    .editor-textarea {
        min-height: 20rem;
        font-size: 0.8125rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Smooth Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Focus Styles for Accessibility */
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Navigation Styles */
.nav-link {
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-link.active {
    color: #3b82f6;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 1px;
}

.toc-link {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.toc-link:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #3b82f6;
    border-color: #3b82f6;
}

/* Code Block Styles */
.bg-gray-900 {
    background-color: #111827;
}

.text-green-400 {
    color: #4ade80;
}

/* Print Styles */
@media print {
    .btn-primary,
    .btn-secondary,
    #theme-toggle,
    footer {
        display: none;
    }
    
    .editor-panel {
        box-shadow: none;
        border: 1px solid #000;
    }
}
