* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #0a0a0a;
    --gray-900: #171717;
    --gray-800: #262626;
    --gray-700: #404040;
    --gray-600: #525252;
    --gray-500: #737373;
    --gray-400: #a3a3a3;
    --gray-300: #d4d4d4;
    --gray-200: #e5e5e5;
    --gray-100: #f5f5f5;
    --white: #ffffff;
    
    --gradient-dark: linear-gradient(135deg, var(--black) 0%, var(--gray-900) 100%);
    --gradient-light: linear-gradient(135deg, var(--white) 0%, var(--gray-100) 100%);
    --gradient-subtle: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--gradient-light);
    color: var(--gray-900);
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-dark);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--gray-600);
}

.nav-info span {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Main Content */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: start;
}

/* Translator Box */
.translator-box {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.translator-box:hover {
    box-shadow: 
        0 8px 12px rgba(0, 0, 0, 0.1),
        0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* Language Switch */
.language-switch {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.switch-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--gradient-subtle);
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
}

.switch-btn:hover {
    border-color: var(--gray-400);
    transform: translateY(-1px);
}

.switch-btn.flipped .switch-text {
    transform: scaleX(-1);
}

.switch-text {
    transition: transform 0.3s ease;
    display: inline-block;
}

/* IO Container */
.io-container {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.input-box, .output-box {
    display: flex;
    flex-direction: column;
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.box-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counter {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
}

#text-input {
    width: 100%;
    height: 140px;
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.2s ease;
    background: var(--white);
    margin-bottom: 1rem;
}

#text-input:focus {
    outline: none;
    border-color: var(--gray-600);
    box-shadow: 0 0 0 3px rgba(64, 64, 64, 0.1);
}

.action-btn {
    align-self: flex-start;
    padding: 0.75rem 2rem;
    background: var(--gradient-dark);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.action-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.result-area {
    height: 140px;
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow-y: auto;
}

.result-area.filled {
    background: var(--white);
    border-color: var(--gray-600);
    align-items: flex-start;
    justify-content: flex-start;
}

.placeholder {
    color: var(--gray-500);
    font-style: italic;
    text-align: center;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--gray-600);
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

/* Status Bar */
.status-bar {
    padding: 1rem 2rem;
    background: var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.method-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.method-glosbe {
    background: var(--gray-200);
    color: var(--gray-800);
}

.method-perplexity {
    background: var(--black);
    color: var(--white);
}

.method-dictionary {
    background: var(--gray-700);
    color: var(--white);
}

.cost-tag {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.stat-grid {
    display: grid;
    gap: 1rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: var(--gradient-subtle);
    border-radius: 8px;
    border-left: 3px solid var(--gray-800);
}

.stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#api-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

#api-input:focus {
    outline: none;
    border-color: var(--gray-600);
}

.save-btn {
    padding: 0.5rem 1rem;
    background: var(--gradient-dark);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: var(--gray-900);
    color: var(--gray-400);
    margin-top: auto;
}

.footer p {
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main {
        padding: 2rem 1rem;
    }
    
    .io-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .translator-box {
        border-radius: 16px;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .nav-content {
        padding: 1rem;
    }
    
    .nav-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .language-switch {
        padding: 1.5rem 1rem 1rem;
    }
    
    .io-container {
        padding: 1rem;
    }
    
    .action-btn {
        width: 100%;
        text-align: center;
    }
}
