/* Common Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Common Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 3rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.translator-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 3rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

/* Common Button Styles */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #4c51bf, #553c9a);
    color: white;
    box-shadow: 0 8px 25px rgba(76, 81, 191, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

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

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Language Selection */
.language-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: end;
    margin-bottom: 2rem;
}

.language-group {
    position: relative;
}

.language-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 1rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 3rem;
}

.language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.swap-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.swap-button:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

/* Translation Section */
.translation-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.text-area-group {
    position: relative;
}

.text-area-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-area {
    width: 100%;
    min-height: 200px;
    padding: 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 1rem;
    font-size: 1rem;
    resize: vertical;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-family: inherit;
}

.text-area:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.text-area::placeholder {
    color: #a0aec0;
}

.text-area.readonly {
    background: rgba(248, 250, 252, 0.8);
    color: #4a5568;
}

/* Action Section */
.action-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Copy, Voice, and Mic Button Styles */
.copy-button, .voice-button, .mic-button {
    position: absolute;
    top: 50px;
    right: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-size: 0.9rem;
    z-index: 2;
}

.voice-button {
    right: 65px; /* Position voice button to the left of copy button */
}

.mic-button {
    right: 115px; /* Position mic button to the left of voice button */
    background: linear-gradient(135deg, #48bb78, #38a169);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.copy-button:hover, .voice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8, #553c9a);
}

.mic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38a169, #2f855a);
}

.copy-button:active, .voice-button:active, .mic-button:active {
    transform: translateY(0);
}

.voice-button.speaking {
    background: linear-gradient(135deg, #48bb78, #38a169);
    animation: pulse 1.5s infinite;
}

.mic-button.recording {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    animation: pulse 1.5s infinite;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.mic-button.recording:hover {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    box-shadow: 0 8px 25px rgba(245, 101, 101, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Adjust text area for button positioning */
.text-area-group {
    position: relative;
}

/* Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 0 1rem;
    }

    .translator-card,
    .card {
        padding: 2rem 1.5rem;
        border-radius: 1.5rem;
    }

    .language-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .swap-button {
        width: 50px;
        height: 50px;
        justify-self: center;
    }

    .translation-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .action-section {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
} 