/* styles.css */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --panel-bg: rgba(255, 255, 255, 0.05);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent: #06b6d4;
    --error: #ef4444;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.app-container {
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    transition: color 0.2s;
}

.settings-header:hover {
    color: var(--primary);
}

.settings-header span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--panel-border);
    animation: fadeIn 0.3s ease;
}

.settings-help {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.settings-help a {
    color: var(--accent);
    text-decoration: none;
}

.settings-help a:hover {
    text-decoration: underline;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

input[type="text"], input[type="password"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

.status-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.status-text.success { color: var(--success); }
.status-text.error { color: var(--error); }

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-box input {
    font-size: 1.2rem;
    padding: 1rem;
}

.search-box button {
    padding: 0 1.5rem;
}

.hidden {
    display: none !important;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: #fca5a5;
    font-size: 0.95rem;
}

.result-container {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.word-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
}

.word-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: capitalize;
}

.audio-btn {
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    flex-shrink: 0;
}

.audio-btn:hover {
    background: var(--primary);
    color: white;
}

.pronunciation-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pronunciation-box .label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pronunciation-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

.definitions-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.definition-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 1rem;
}

.pos {
    display: inline-block;
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.def-text {
    line-height: 1.6;
    color: var(--text-main);
    padding-left: 1.2rem;
}

.def-text li {
    margin-bottom: 0.5rem;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.speed-control {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#speed-value {
    color: var(--accent);
    font-weight: 600;
    min-width: 2.5rem;
    display: inline-block;
}

#speed-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: background 0.2s;
}

#speed-slider::-webkit-slider-thumb:hover {
    background: var(--accent);
}
