/* 
   TEXT COMPARE - EXPERT WEB TOOLS
   Theme: 2025 Glassmorphism
*/

/* --- Fonts --- */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/roboto-mono-v31-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
    --bg-dark: #0a0a0f;
    --primary-accent: #3b82f6;
    --secondary-accent: #8b5cf6;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --card-bg: rgba(25, 25, 35, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.05);
    
    /* Diff Colors */
    --ins-bg: rgba(16, 185, 129, 0.15);
    --del-bg: rgba(239, 68, 68, 0.15);
    --ins-text: #6ee7b7;
    --del-text: #fca5a5;
    
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, rgba(10, 10, 15, 0) 50%);
    z-index: -1;
    pointer-events: none;
}

/* --- Header --- */
.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}
.back-btn:hover { color: var(--primary-accent); }
.logo { font-family: var(--font-heading); font-size: 1.2rem; }
.logo span { color: var(--primary-accent); }

/* --- Main Layout --- */
.main-content {
    flex-grow: 1;
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tool-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tool-intro { text-align: center; margin-bottom: 2rem; }
.tool-intro h1 { font-family: var(--font-heading); margin-bottom: 0.5rem; font-size: 2rem; }
.tool-intro p { color: var(--text-muted); }

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 1rem;
}

.control-group label { margin-right: 10px; color: var(--text-muted); }

/* --- FIXED DROPDOWN STYLES --- */
select {
    background-color: var(--input-bg); /* Use background-color specifically */
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-body); /* Force correct font */
    font-size: 0.9rem;
}

/* Explicitly style options to prevent white background on Windows/Chrome */
select option {
    background-color: var(--bg-dark); /* Solid dark background */
    color: #fff;
    font-family: var(--font-body);
    padding: 10px;
}

.action-group { display: flex; gap: 10px; }

button {
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
}

.primary-btn { background: var(--primary-accent); color: #fff; border-color: var(--primary-accent); }
.primary-btn:hover { background: #2563eb; }

.secondary-btn { background: transparent; color: var(--text-muted); }
.secondary-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }

.danger-btn { background: transparent; color: #ef4444; border-color: rgba(239,68,68,0.3); }
.danger-btn:hover { background: rgba(239,68,68,0.1); }

/* Input Grid */
.io-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.io-column { display: flex; flex-direction: column; gap: 10px; }

.column-header { display: flex; justify-content: space-between; align-items: center; }
.column-header h3 { font-size: 1rem; color: var(--text-muted); font-family: var(--font-heading); }

.file-upload {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--primary-accent);
    display: flex;
    align-items: center;
    gap: 5px;
}
.file-upload:hover { text-decoration: underline; }

textarea {
    width: 100%;
    min-height: 300px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    color: #fff;
    font-family: var(--font-code);
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
}
textarea:focus { border-color: var(--primary-accent); }
textarea.drag-over { border-color: var(--primary-accent); background: rgba(59, 130, 246, 0.1); }

/* Results Section */
.results-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}
.results-header h3 { font-family: var(--font-heading); font-size: 1.1rem; }

.diff-stats { font-family: var(--font-code); font-size: 0.9rem; color: var(--text-muted); }
.stat-add { color: #10b981; }
.stat-del { color: #ef4444; }

.view-toggle { background: rgba(0,0,0,0.3); padding: 4px; border-radius: 8px; display: inline-flex; }
.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.toggle-btn.active { background: var(--primary-accent); color: #fff; }

/* Diff Views */
#inline-output {
    font-family: var(--font-code);
    white-space: pre-wrap;
    line-height: 1.5;
    color: #cbd5e1;
    font-size: 0.9rem;
}

#side-by-side-output {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border-top: 1px solid var(--card-border);
}

.diff-pane {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-top: 1rem;
}

.line-numbers {
    color: var(--text-muted);
    text-align: right;
    padding-right: 10px;
    user-select: none;
    border-right: 1px solid var(--card-border);
    font-family: var(--font-code);
    font-size: 0.9rem;
    line-height: 1.5;
}

.diff-content {
    font-family: var(--font-code);
    white-space: pre;
    line-height: 1.5;
    color: #cbd5e1;
    font-size: 0.9rem;
    width: 100%;
}

/* Diff Highlighting */
ins { text-decoration: none; background: var(--ins-bg); display: block; }
del { text-decoration: none; background: var(--del-bg); display: block; }

ins span { color: var(--ins-text); font-weight: bold; background: rgba(16, 185, 129, 0.2); }
del span { color: var(--del-text); font-weight: bold; background: rgba(239, 68, 68, 0.2); }

.diff-placeholder { background: rgba(255,255,255,0.05); display: block; }

/* Info Section */
.info-section { margin-top: 4rem; padding: 0 1rem; }
.info-section h2 { font-family: var(--font-heading); margin-bottom: 2rem; color: var(--text-main); font-size: 1.5rem; text-align: center; }
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.info-grid h3 { color: var(--primary-accent); margin-bottom: 0.5rem; font-family: var(--font-heading); font-size: 1rem; }
.info-grid p { color: var(--text-muted); font-size: 0.9rem; }

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-container);
    border: 1px solid var(--primary-accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 2000;
}

.hidden { display: none !important; }
.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; }

footer { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--card-border); margin-top: 3rem; }
footer a { color: #fff; text-decoration: none; }

@media (max-width: 900px) {
    .io-grid { grid-template-columns: 1fr; }
    textarea { min-height: 200px; }
    #side-by-side-output { grid-template-columns: 1fr; }
}