:root {
    --bg-color: #0b0c10;
    --surface-color: rgba(31, 40, 51, 0.6);
    --surface-border: rgba(102, 252, 241, 0.15);
    --primary-color: #45f3ff;
    --primary-gradient: linear-gradient(135deg, #45f3ff 0%, #66fcf1 100%);
    --secondary-color: #1f2833;
    --text-main: #c5c6c7;
    --text-bright: #ffffff;
    --success-color: #4cd137;
    --error-color: #e84118;
    
    --glass-bg: rgba(31, 40, 51, 0.4);
    --glass-blur: blur(12px);
    
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(69, 243, 255, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(102, 252, 241, 0.05), transparent 25%);
}

.app-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 10px;
}
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}
.sparkle {
    color: var(--primary-color);
    font-size: 28px;
    animation: pulse 2s infinite ease-in-out;
}
.logo h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.5px;
}
.subtitle {
    font-size: 16px;
    color: rgba(197, 198, 199, 0.7);
}

/* Glass Panels */
.control-panel, .results-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.control-panel:hover {
    box-shadow: 0 8px 32px 0 rgba(69, 243, 255, 0.05);
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.lang-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lang-group label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    font-weight: 500;
}
select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-bright);
    font-size: 15px;
    font-family: var(--font-family);
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
select:focus {
    border-color: var(--primary-color);
}
select option {
    background: var(--secondary-color);
    color: var(--text-bright);
}

/* Input Area */
.input-area {
    margin-bottom: 24px;
}
.sr-only { display: none; }
textarea {
    width: 100%;
    min-height: 140px;
    padding: 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    color: var(--text-bright);
    font-size: 16px;
    font-family: var(--font-family);
    resize: vertical;
    outline: none;
    line-height: 1.5;
    transition: all 0.3s ease;
}
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(69, 243, 255, 0.1);
}
textarea::placeholder {
    color: rgba(197, 198, 199, 0.4);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: var(--bg-color);
    font-weight: 700;
    font-size: 16px;
    font-family: var(--font-family);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}
.btn-primary:active {
    transform: scale(0.98);
}
.btn-primary:hover {
    box-shadow: 0 0 20px rgba(69, 243, 255, 0.4);
}
.btn-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-color);
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Progress */
.results-panel {
    display: none; /* controlled via js */
}
.progress-wrapper {
    margin-bottom: 24px;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.result-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 16px;
    animation: slideUp 0.4s ease forwards;
    position: relative;
}
.result-card.completed {
    border-left: 4px solid var(--primary-color);
}
.result-card.failed {
    border-left: 4px solid var(--error-color);
}
.result-origin {
    font-size: 13px;
    color: rgba(197, 198, 199, 0.6);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--surface-border);
}
.result-translated {
    font-size: 16px;
    color: var(--text-bright);
    line-height: 1.5;
}
.result-error {
    color: var(--error-color);
    font-size: 14px;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--primary-color); }
    50% { opacity: 0.5; text-shadow: none; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
