600 lines
12 KiB
CSS
600 lines
12 KiB
CSS
/* Variabili colori - Design allegro e moderno */
|
|
:root {
|
|
--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
--secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
|
--success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
|
--warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
|
|
|
|
--bg-primary: #f8fafc;
|
|
--bg-secondary: #ffffff;
|
|
--bg-tertiary: #f1f5f9;
|
|
|
|
--text-primary: #1e293b;
|
|
--text-secondary: #64748b;
|
|
--text-tertiary: #94a3b8;
|
|
|
|
--border-color: #e2e8f0;
|
|
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
|
|
--radius-sm: 8px;
|
|
--radius-md: 12px;
|
|
--radius-lg: 16px;
|
|
--radius-xl: 24px;
|
|
|
|
--transition-fast: 150ms ease;
|
|
--transition-normal: 250ms ease;
|
|
--transition-slow: 350ms ease;
|
|
}
|
|
|
|
/* Reset e base */
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
line-height: 1.6;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Container principale */
|
|
.app-container {
|
|
height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--bg-primary);
|
|
}
|
|
|
|
/* Header */
|
|
.app-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 16px 24px;
|
|
background: var(--bg-secondary);
|
|
border-bottom: 1px solid var(--border-color);
|
|
box-shadow: var(--shadow-sm);
|
|
position: relative;
|
|
z-index: 10;
|
|
}
|
|
|
|
.logo {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.logo svg {
|
|
width: 36px;
|
|
height: 36px;
|
|
color: #667eea;
|
|
background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
|
|
padding: 6px;
|
|
border-radius: var(--radius-md);
|
|
}
|
|
|
|
.logo h1 {
|
|
font-size: 1.5rem;
|
|
font-weight: 800;
|
|
background: var(--primary-gradient);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
.settings-btn {
|
|
width: 44px;
|
|
height: 44px;
|
|
border: none;
|
|
background: var(--bg-tertiary);
|
|
border-radius: var(--radius-md);
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: all var(--transition-normal);
|
|
}
|
|
|
|
.settings-btn:hover {
|
|
background: var(--primary-gradient);
|
|
color: white;
|
|
transform: rotate(30deg);
|
|
}
|
|
|
|
.settings-btn svg {
|
|
width: 22px;
|
|
height: 22px;
|
|
}
|
|
|
|
/* Indicatore lingua automatica */
|
|
.language-indicator {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 16px 24px;
|
|
background: var(--bg-secondary);
|
|
border-bottom: 1px solid var(--border-color);
|
|
}
|
|
|
|
.language-indicator span {
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
color: var(--text-secondary);
|
|
padding: 8px 20px;
|
|
background: var(--bg-tertiary);
|
|
border-radius: var(--radius-lg);
|
|
transition: all var(--transition-normal);
|
|
}
|
|
|
|
.language-indicator span.detected-it {
|
|
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
|
|
color: white;
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
.language-indicator span.detected-en {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
/* Area traduzione */
|
|
.translation-area {
|
|
flex: 1;
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 24px;
|
|
padding: 24px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.input-section,
|
|
.output-section {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
}
|
|
|
|
.textarea-container {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--bg-secondary);
|
|
border-radius: var(--radius-lg);
|
|
box-shadow: var(--shadow-md);
|
|
overflow: hidden;
|
|
transition: box-shadow var(--transition-normal);
|
|
}
|
|
|
|
.textarea-container:focus-within {
|
|
box-shadow: var(--shadow-xl);
|
|
}
|
|
|
|
textarea {
|
|
flex: 1;
|
|
width: 100%;
|
|
padding: 20px;
|
|
border: none;
|
|
background: transparent;
|
|
font-family: inherit;
|
|
font-size: 1.1rem;
|
|
line-height: 1.7;
|
|
color: var(--text-primary);
|
|
resize: none;
|
|
outline: none;
|
|
}
|
|
|
|
textarea::placeholder {
|
|
color: var(--text-tertiary);
|
|
}
|
|
|
|
#outputText {
|
|
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
|
}
|
|
|
|
.textarea-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 12px 20px;
|
|
border-top: 1px solid var(--border-color);
|
|
background: var(--bg-tertiary);
|
|
}
|
|
|
|
.action-btn {
|
|
width: 36px;
|
|
height: 36px;
|
|
border: none;
|
|
background: transparent;
|
|
border-radius: var(--radius-md);
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--text-secondary);
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.action-btn:hover {
|
|
background: var(--bg-secondary);
|
|
color: #667eea;
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
.action-btn svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.char-count {
|
|
font-size: 0.875rem;
|
|
color: var(--text-tertiary);
|
|
font-weight: 500;
|
|
}
|
|
|
|
/* Status indicator */
|
|
.status-indicator {
|
|
width: 12px;
|
|
height: 12px;
|
|
border-radius: 50%;
|
|
background: var(--text-tertiary);
|
|
transition: all var(--transition-normal);
|
|
}
|
|
|
|
.status-indicator.translating {
|
|
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
|
animation: pulse 1.5s infinite;
|
|
}
|
|
|
|
.status-indicator.success {
|
|
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
|
|
}
|
|
|
|
.status-indicator.error {
|
|
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0%, 100% {
|
|
transform: scale(1);
|
|
opacity: 1;
|
|
}
|
|
50% {
|
|
transform: scale(1.2);
|
|
opacity: 0.7;
|
|
}
|
|
}
|
|
|
|
/* Pulsante traduci */
|
|
.translate-section {
|
|
padding: 0 24px 24px;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.translate-btn {
|
|
padding: 16px 48px;
|
|
border: none;
|
|
background: var(--primary-gradient);
|
|
border-radius: var(--radius-xl);
|
|
color: white;
|
|
font-family: inherit;
|
|
font-size: 1.1rem;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
transition: all var(--transition-normal);
|
|
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
.translate-btn:hover:not(:disabled) {
|
|
transform: translateY(-3px) scale(1.02);
|
|
box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
|
|
}
|
|
|
|
.translate-btn:active:not(:disabled) {
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.translate-btn:disabled {
|
|
opacity: 0.7;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.btn-icon {
|
|
width: 20px;
|
|
height: 20px;
|
|
transition: transform var(--transition-normal);
|
|
}
|
|
|
|
.translate-btn:hover:not(:disabled) .btn-icon {
|
|
transform: translateX(4px);
|
|
}
|
|
|
|
.spinner {
|
|
width: 20px;
|
|
height: 20px;
|
|
border: 3px solid rgba(255, 255, 255, 0.3);
|
|
border-top-color: white;
|
|
border-radius: 50%;
|
|
animation: spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
/* Modal */
|
|
.modal {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
z-index: 1000;
|
|
align-items: center;
|
|
justify-content: center;
|
|
backdrop-filter: blur(4px);
|
|
opacity: 0;
|
|
transition: opacity var(--transition-normal);
|
|
}
|
|
|
|
.modal.show {
|
|
display: flex;
|
|
opacity: 1;
|
|
}
|
|
|
|
.modal-content {
|
|
background: var(--bg-secondary);
|
|
border-radius: var(--radius-xl);
|
|
width: 90%;
|
|
max-width: 500px;
|
|
box-shadow: var(--shadow-xl);
|
|
transform: scale(0.95);
|
|
transition: transform var(--transition-normal);
|
|
}
|
|
|
|
.modal.show .modal-content {
|
|
transform: scale(1);
|
|
}
|
|
|
|
.modal-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 24px;
|
|
border-bottom: 1px solid var(--border-color);
|
|
}
|
|
|
|
.modal-header h2 {
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.close-btn {
|
|
width: 36px;
|
|
height: 36px;
|
|
border: none;
|
|
background: transparent;
|
|
border-radius: var(--radius-md);
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--text-secondary);
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.close-btn:hover {
|
|
background: var(--bg-tertiary);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.close-btn svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.modal-body {
|
|
padding: 24px;
|
|
}
|
|
|
|
.setting-item {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.setting-item:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.setting-item label {
|
|
display: block;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
margin-bottom: 8px;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.setting-item input,
|
|
.setting-item select {
|
|
width: 100%;
|
|
padding: 12px 16px;
|
|
border: 2px solid var(--border-color);
|
|
border-radius: var(--radius-md);
|
|
font-family: inherit;
|
|
font-size: 1rem;
|
|
color: var(--text-primary);
|
|
background: var(--bg-primary);
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.setting-item input:focus,
|
|
.setting-item select:focus {
|
|
outline: none;
|
|
border-color: #667eea;
|
|
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
|
}
|
|
|
|
.help-text {
|
|
display: block;
|
|
font-size: 0.875rem;
|
|
color: var(--text-tertiary);
|
|
margin-top: 6px;
|
|
}
|
|
|
|
.refresh-btn {
|
|
margin-top: 10px;
|
|
padding: 10px 16px;
|
|
border: 2px solid var(--border-color);
|
|
background: var(--bg-primary);
|
|
border-radius: var(--radius-md);
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-family: inherit;
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
color: var(--text-secondary);
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.refresh-btn:hover:not(:disabled) {
|
|
border-color: #667eea;
|
|
color: #667eea;
|
|
}
|
|
|
|
.refresh-btn:disabled {
|
|
opacity: 0.6;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.refresh-btn svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
|
|
.refresh-btn svg.spin {
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
.modal-footer {
|
|
padding: 20px 24px;
|
|
border-top: 1px solid var(--border-color);
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.save-btn {
|
|
padding: 12px 32px;
|
|
border: none;
|
|
background: var(--primary-gradient);
|
|
border-radius: var(--radius-lg);
|
|
color: white;
|
|
font-family: inherit;
|
|
font-size: 1rem;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
transition: all var(--transition-fast);
|
|
}
|
|
|
|
.save-btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: var(--shadow-md);
|
|
}
|
|
|
|
/* Toast Notification */
|
|
.toast {
|
|
position: fixed;
|
|
bottom: 24px;
|
|
left: 50%;
|
|
transform: translateX(-50%) translateY(100px);
|
|
padding: 16px 32px;
|
|
background: var(--bg-secondary);
|
|
border-radius: var(--radius-lg);
|
|
box-shadow: var(--shadow-xl);
|
|
font-weight: 600;
|
|
z-index: 2000;
|
|
opacity: 0;
|
|
transition: all var(--transition-normal);
|
|
}
|
|
|
|
.toast.show {
|
|
transform: translateX(-50%) translateY(0);
|
|
opacity: 1;
|
|
}
|
|
|
|
.toast.success {
|
|
background: var(--success-gradient);
|
|
color: white;
|
|
}
|
|
|
|
.toast.error {
|
|
background: var(--secondary-gradient);
|
|
color: white;
|
|
}
|
|
|
|
.toast.warning {
|
|
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
|
color: white;
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 768px) {
|
|
.translation-area {
|
|
grid-template-columns: 1fr;
|
|
grid-template-rows: 1fr 1fr;
|
|
}
|
|
|
|
.language-selector {
|
|
flex-wrap: wrap;
|
|
gap: 12px;
|
|
}
|
|
|
|
.lang-group {
|
|
flex: 1;
|
|
justify-content: center;
|
|
}
|
|
|
|
.swap-btn {
|
|
order: 1;
|
|
width: 40px;
|
|
height: 40px;
|
|
}
|
|
}
|
|
|
|
/* Scrollbar personalizzata */
|
|
::-webkit-scrollbar {
|
|
width: 8px;
|
|
height: 8px;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
background: var(--bg-tertiary);
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
|
|
}
|