/* WritingBot.ai - Custom Styles */
/* Supplements Bootstrap 5 */

/* Brand Colors */
:root {
    --brand-600: #1a3fff;
    --brand-700: #0f2ee6;
    --brand-50: #f0f5ff;
    --accent-500: #47a34c;
    --accent-600: #36853a;
}
.text-brand { color: var(--brand-600) !important; }
.bg-brand { background-color: var(--brand-600) !important; }
.bg-brand-50 { background-color: var(--brand-50) !important; }
.btn-brand {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
    color: white;
}
.btn-brand:hover {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
    color: white;
}
.btn-outline-brand {
    color: var(--brand-600);
    border-color: var(--brand-600);
}
.btn-outline-brand:hover {
    background-color: var(--brand-600);
    color: white;
}
.gradient-text-brand {
    background: linear-gradient(135deg, #1a3fff, #3b66ff, #47a34c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dropdown item custom hover */
.dropdown-item-custom,
.dropdown-item-custom:hover,
.dropdown-item-custom:focus,
.dropdown-item-custom:active {
    text-decoration: none !important;
    color: inherit;
    display: flex;
}
.dropdown-item-custom:hover {
    background-color: #f0f5ff;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Base layout */
html, body {
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Tool split-pane layout */
.split-pane {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    min-height: 400px;
}

@media (max-width: 768px) {
    .split-pane {
        grid-template-columns: 1fr;
    }
}

/* Text editor panes */
.text-pane {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 300px;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.text-pane:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Diff highlighting */
.diff-changed {
    background-color: #dbeafe;
    border-radius: 2px;
    padding: 0 1px;
}

.diff-structural {
    background-color: #fef3c7;
    border-radius: 2px;
    padding: 0 1px;
}

.diff-unchanged {
    background-color: #e0f2fe;
    border-radius: 2px;
    padding: 0 1px;
}

/* Grammar error highlights */
.grammar-error {
    border-bottom: 2px wavy #ef4444;
    cursor: pointer;
}

.grammar-error-spelling {
    border-bottom: 2px wavy #ef4444;
}

.grammar-error-grammar {
    border-bottom: 2px wavy #f59e0b;
}

.grammar-error-style {
    border-bottom: 2px wavy #3b82f6;
}

/* AI Detection colors */
.ai-score-high {
    background-color: #fee2e2;
    color: #991b1b;
}

.ai-score-medium-high {
    background-color: #ffedd5;
    color: #9a3412;
}

.ai-score-medium-low {
    background-color: #fef9c3;
    color: #854d0e;
}

.ai-score-low {
    background-color: #dcfce7;
    color: #166534;
}

/* Synonym slider */
.synonym-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #6366f1, #a855f7);
    border-radius: 3px;
    outline: none;
}

.synonym-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.synonym-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Frozen word badge */
.frozen-word {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    padding: 0 4px;
    cursor: pointer;
    user-select: none;
}

.frozen-word:hover {
    background-color: #bfdbfe;
}

/* Mode tabs */
.mode-tab {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.mode-tab:hover {
    background-color: #f3f4f6;
}

.mode-tab.active {
    background-color: #6366f1;
    color: white;
}

.mode-tab.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Writing score circles */
.score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Loading spinner */
.spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button states */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Gauge / progress bar */
.gauge-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e5e7eb;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* File drop zone */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #6366f1;
    background-color: #eef2ff;
}

/* Word click synonyms dropdown */
.word-clickable {
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.15s;
}

.word-clickable:hover {
    background-color: #e0e7ff;
}

/* Pricing cards */
.pricing-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
    border: 2px solid #6366f1;
}

/* Tool card */
.tool-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Flow editor */
.flow-editor {
    min-height: 500px;
    outline: none;
    line-height: 1.8;
}

.flow-sidebar {
    width: 380px;
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .flow-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

/* Citation list */
.citation-item {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: background-color 0.15s;
}

.citation-item:hover {
    background-color: #f9fafb;
}

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Premium badge */
.premium-badge {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
