:root {
    --primary-color: #0052CC;
    --primary-hover: #0747A6;
    --secondary-color: #42526E;
    --success-color: #00875A;
    --error-color: #DE350B;
    --warning-color: #FF991F;
    --background: #FFFFFF;
    --surface: #F4F5F7;
    --border: #DFE1E6;
    --text-primary: #172B4D;
    --text-secondary: #6B778C;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: var(--surface);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--background);
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    text-align: center;
    position: relative;
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.icon {
    width: 36px;
    height: 36px;
    color: var(--primary-color);
}

.app-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

.language-selector {
    position: absolute;
    top: 24px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.lang-btn {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.lang-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

.input-section {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.char-count {
    text-align: right;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.controls {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.summary-length {
    flex: 1;
    min-width: 200px;
}

.select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--background);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.output-section {
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: opacity 0.3s ease;
}

.output-section.hidden {
    display: none;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.output-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-output {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius-sm);
    min-height: 100px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 16px;
}

.summary-stats {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.footer {
    background: var(--background);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .app-title {
        font-size: 24px;
    }
    
    .icon {
        width: 28px;
        height: 28px;
    }
    
    .language-selector {
        position: static;
        margin-top: 16px;
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .summary-length {
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .output-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}