/* Translation Feedback Styles - Matching Australian Citizenship Test Design */

/* Floating Action Button */
.translation-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: auto;
    min-width: 200px;
    height: auto;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--aus-green, #00843d) 0%, var(--aus-green-dark, #006930) 100%);
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 132, 61, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    color: white;
    border: 2px solid transparent;
}

.translation-fab:hover {
    background: linear-gradient(135deg, var(--aus-green-dark, #006930) 0%, #005025 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 132, 61, 0.4);
    border-color: var(--aus-gold, #ffcd00);
}

.translation-fab:active {
    transform: translateY(0) scale(0.98);
}

/* FAB Text Container */
.fab-text {
    text-align: center;
}

.fab-english {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.fab-translation {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    min-height: 18px;
    transition: opacity 0.3s ease;
}

/* Animation for translation text */
@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

.fab-translation.animating {
    animation: fadeInOut 2s ease-in-out;
}



/* Modal Overlay */
.translation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

/* Modal Content */
.translation-modal-content {
    background: var(--bg-white, #ffffff);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.translation-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light, #e0e7ed);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-light, #f8fbfd) 0%, #ffffff 100%);
    border-radius: 16px 16px 0 0;
}

.translation-modal-header h2 {
    margin: 0;
    color: var(--aus-green, #00843d);
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.translation-modal-header h2::before {
    content: '🌐';
    font-size: 32px;
}

.translation-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-secondary, #4a5f7a);
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.translation-modal-close:hover {
    background: rgba(0, 132, 61, 0.1);
    color: var(--aus-green, #00843d);
    transform: rotate(90deg);
}

/* Form Styles */
#translationFeedbackForm {
    padding: 32px;
}

.translation-form-group {
    margin-bottom: 24px;
}

.translation-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    font-size: 16px;
}

.translation-form-group.required label {
    color: var(--text-primary, #1a1a2e);
}

.required-star {
    color: #d32f2f;
    margin-left: 4px;
}

.translation-form-group input,
.translation-form-group textarea {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border-light, #e0e7ed);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    background: var(--bg-white, #ffffff);
}

.translation-form-group input:focus,
.translation-form-group textarea:focus {
    outline: none;
    border-color: var(--aus-green, #00843d);
    box-shadow: 0 0 0 3px rgba(0, 132, 61, 0.1);
    background: #ffffff;
}

.translation-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* reCAPTCHA Container */
#g-recaptcha {
    margin: 0 auto;
    display: table;
}

/* Form Actions */
.translation-form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid var(--border-light, #e0e7ed);
    margin-top: 32px;
}

.btn-primary,
.btn-secondary {
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--aus-green, #00843d) 0%, var(--aus-green-dark, #006930) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 132, 61, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--aus-green-dark, #006930) 0%, #005025 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 132, 61, 0.4);
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--aus-green, #00843d);
    border: 2px solid var(--aus-green, #00843d);
}

.btn-secondary:hover {
    background: var(--aus-green, #00843d);
    color: white;
    transform: translateY(-1px);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 48px 32px;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-message svg {
    margin-bottom: 24px;
    animation: checkmark 0.6s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(-45deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.success-message h3 {
    color: #4CAF50;
    margin-bottom: 16px;
    font-size: 28px;
}

.success-message p {
    color: var(--text-secondary, #4a5f7a);
    margin-bottom: 32px;
    font-size: 18px;
    line-height: 1.6;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Scrollbar Styling */
.translation-modal-content::-webkit-scrollbar {
    width: 8px;
}

.translation-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.translation-modal-content::-webkit-scrollbar-thumb {
    background: var(--aus-green, #00843d);
    border-radius: 4px;
}

.translation-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--aus-green-dark, #006930);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .translation-fab {
        bottom: 20px;
        right: 20px;
        min-width: 160px;
        padding: 12px 18px;
    }
    
    .fab-english {
        font-size: 12px;
    }
    
    .fab-translation {
        font-size: 11px;
        min-height: 16px;
    }
    
    .translation-modal {
        padding: 0;
    }
    
    .translation-modal-content {
        margin: 0;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .translation-modal-header {
        padding: 20px;
        border-radius: 0;
    }
    
    .translation-modal-header h2 {
        font-size: 24px;
    }
    
    .translation-modal-header h2::before {
        font-size: 24px;
    }
    
    #translationFeedbackForm {
        padding: 20px;
    }
    
    .translation-form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 16px;
    }
    
    .success-message {
        padding: 32px 20px;
    }
    
    .success-message h3 {
        font-size: 24px;
    }
    
    .success-message p {
        font-size: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .translation-fab {
        border: 2px solid white;
    }
    
    .translation-modal-content {
        border: 2px solid black;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .translation-modal-content {
        background: #2a2a2a;
        color: white;
    }
    
    .translation-modal-header {
        background: linear-gradient(135deg, #333333 0%, #2a2a2a 100%);
        border-bottom-color: #444;
    }
    
    .translation-modal-header h2 {
        color: var(--aus-gold, #ffcd00);
    }
    
    .translation-form-group label {
        color: #e0e0e0;
    }
    
    .translation-form-group input,
    .translation-form-group textarea {
        background: #333333;
        border-color: #444;
        color: white;
    }
    
    .translation-form-group input:focus,
    .translation-form-group textarea:focus {
        background: #3a3a3a;
        border-color: var(--aus-gold, #ffcd00);
        box-shadow: 0 0 0 3px rgba(255, 205, 0, 0.2);
    }
    
    .btn-secondary {
        color: var(--aus-gold, #ffcd00);
        border-color: var(--aus-gold, #ffcd00);
    }
    
    .btn-secondary:hover {
        background: var(--aus-gold, #ffcd00);
        color: #2a2a2a;
    }
}

/* RTL Support */
[dir="rtl"] .translation-fab {
    right: auto;
    left: 30px;
}

[dir="rtl"] .translation-modal-header h2::before {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .translation-form-actions {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    [dir="rtl"] .translation-fab {
        left: 20px;
    }
    
    [dir="rtl"] .translation-form-actions {
        flex-direction: column-reverse;
    }
}