/* Reset e variabili */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    background: var(--surface);
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 4px 6px var(--shadow);
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

.mode-btn .icon {
    font-size: 1.4rem;
    transition: var(--transition);
}

.mode-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-light);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.mode-btn.active .icon {
    transform: scale(1.1);
}

/* Content Area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section,
.output-section {
    background: var(--surface);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 6px var(--shadow);
    transition: var(--transition);
}

.input-section:hover,
.output-section:hover {
    box-shadow: 0 8px 16px var(--shadow);
    transform: translateY(-2px);
}

.section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.char-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.text-area {
    width: 100%;
    padding: 16px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Poppins', monospace;
    resize: vertical;
    transition: var(--transition);
    line-height: 1.6;
}

.text-area:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.text-area::placeholder {
    color: var(--text-muted);
}

.text-area.output {
    background: var(--surface-light);
    cursor: default;
}

/* Arrow Container */
.arrow-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.arrow {
    width: 40px;
    height: 40px;
    color: var(--primary-light);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

/* Copy Button */
.output-section {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: var(--success-color);
}

.copy-icon {
    font-size: 1.1rem;
}

/* Info Box */
.info-box {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
}

.info-text strong {
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .mode-selector {
        gap: 10px;
        padding: 8px;
    }

    .mode-btn {
        padding: 14px 18px;
        font-size: 1rem;
        flex-direction: column;
        gap: 6px;
    }

    .mode-btn .text {
        font-size: 0.9rem;
    }

    .input-section,
    .output-section {
        padding: 20px;
    }

    .text-area {
        font-size: 0.95rem;
        padding: 14px;
    }

    .copy-btn {
        position: static;
        width: 100%;
        margin-top: 12px;
        justify-content: center;
    }

    .section-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-box {
        padding: 16px;
    }

    .info-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .mode-btn {
        padding: 12px 14px;
    }

    .mode-btn .icon {
        font-size: 1.2rem;
    }

    .text-area {
        font-size: 0.9rem;
    }
}
