/* Dynamic Animated Background */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes floatingParticle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(-45deg, #1a2234, #1b2636, #233248, #2c3e50);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: white;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before, body::after {
    content: "";
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

body::before {
    background: radial-gradient(circle at center, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
}

body::after {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* Floating Particles */
.container {
    width: 90%;
    max-width: 600px;
    text-align: center;
    padding: 20px;
    position: relative;
    z-index: 1;
    background-color: rgba(27, 38, 54, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease-out;
}

.container::before {
    content: "";
    position: absolute;
    height: 200%;
    width: 200%;
    top: -50%;
    left: -50%;
    z-index: -1;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    transform: rotate(45deg);
}

.particle {
    position: fixed;
    width: 5px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: floatingParticle 15s infinite linear;
    z-index: -1;
}

.particle:nth-child(1) { left: 10%; animation-duration: 15s; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-duration: 18s; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-duration: 14s; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-duration: 16s; animation-delay: 1s; }
.particle:nth-child(5) { left: 50%; animation-duration: 19s; animation-delay: 5s; }
.particle:nth-child(6) { left: 60%; animation-duration: 12s; animation-delay: 3s; }
.particle:nth-child(7) { left: 70%; animation-duration: 17s; animation-delay: 0s; }
.particle:nth-child(8) { left: 80%; animation-duration: 13s; animation-delay: 2s; }
.particle:nth-child(9) { left: 90%; animation-duration: 20s; animation-delay: 4s; }

/* Enhanced elements styling */
h1 {
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

h1::after {
    content: "";
    position: absolute;
    width: 70%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
    bottom: -10px;
    left: 15%;
}

.record-btn {
    width: 180px;
    height: 180px;
    border-radius: 90px;
    border: none;
    background-color: #ff4b4b;
    color: white;
    font-weight: bold;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.record-btn:hover {
    background-color: #e04040;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 75, 75, 0.8), 0 6px 16px rgba(0, 0, 0, 0.3);
}

.record-btn.recording {
    background-color: #4CAF50;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.8), 0 6px 16px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.result {
    min-height: 80px;
    max-height: 120px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 18px;
    line-height: 1.5;
    text-align: center;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 16px;
    resize: none;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.copy-btn {
    padding: 12px 24px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 16px;
}

.copy-btn:hover {
    background-color: #34495e;
}

.copy-btn.copied {
    background-color: #4CAF50;
}

.footer {
    margin-top: 20px;
    font-size: 12px;
    opacity: 0.7;
}

.language-info {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.transcription-container {
    width: 100%;
    margin-bottom: 24px;
}

.transcription-container h3 {
    text-align: left;
    margin-bottom: 16px;
}

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

.transcription-container .clear-all-btn {
    padding: 8px 16px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 14px;
}

.transcription-container .clear-all-btn:hover {
    background-color: #34495e;
    box-shadow: 0 0 10px rgba(52, 73, 94, 0.8);
    transform: translateY(-2px);
}

.transcription-list {
    list-style-type: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transcription-list li {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: background-color 0.2s;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.transcription-list li:first-child {
    background-color: rgba(52, 152, 219, 0.05);
    border-left: 3px solid #3498db;
    animation: highlightNew 2s ease-out;
}

@keyframes highlightNew {
    0% { background-color: rgba(52, 152, 219, 0.2); }
    100% { background-color: rgba(52, 152, 219, 0.05); }
}

.transcription-list li:last-child {
    border-bottom: none;
}

.transcription-list li:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.transcription-list li .text-content {
    flex-grow: 1;
    padding-right: 170px; /* Space for 5 buttons */
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
    user-select: text; /* Explicitly allow text selection */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text; /* Show text cursor on hover */
    position: relative; /* Ensure position context for pseudo-elements */
}

/* Add invisible touch target to improve selection on mobile */
.transcription-list li .text-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 170px; /* Match padding-right */
    bottom: 0;
    z-index: 1; /* Above text but below selection */
    pointer-events: none; /* Don't interfere with selection */
}

/* Improve text selection highlighting */
.transcription-list li .text-content::selection,
.transcription-list li .text-content *::selection {
    background-color: rgba(52, 152, 219, 0.5); /* Bright blue, semi-transparent */
    color: white;
}

/* Add better touch area for first tap in mobile */
@media (max-width: 480px) {
    .transcription-list li .text-content {
        min-height: 44px; /* Minimum touch target size */
        display: flex;
        align-items: center;
    }
    
    /* Make initial tap easier on mobile */
    .transcription-list li .text-content::after {
        content: "";
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        z-index: -1;
    }
}

.transcription-list li .item-buttons {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 6px; /* Reduced gap */
}

.transcription-list li .copy-btn,
.transcription-list li .delete-btn {
    width: 32px; /* Reduced from 36px */
    height: 32px; /* Reduced from 36px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0;
    transition: all 0.2s;
    min-width: 32px; /* Ensure consistent width */
}

.transcription-list li .copy-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.transcription-list li .delete-btn:hover {
    background-color: #e74c3c;
    transform: scale(1.1);
}

.transcription-list li .copy-btn.copied {
    background-color: #27ae60;
    color: white;
}

.transcription-list li .translate-btn {
    position: relative;
    width: 32px; /* Match other buttons */
    height: 32px; /* Match other buttons */
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    color: #3498db;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px; /* Ensure consistent width */
}

.transcription-list li .translate-btn:hover {
    background-color: #3498db;
    color: white;
    transform: scale(1.1);
}

/* Ensure SVG icons are properly sized */
.transcription-list li .copy-btn svg,
.transcription-list li .delete-btn svg,
.transcription-list li .translate-btn svg,
.transcription-list li .prompt-btn svg,
.transcription-list li .edit-btn svg {
    width: 14px;
    height: 14px;
}

/* Improve responsiveness for smaller screens */
@media (max-width: 480px) {
    .transcription-list li .text-content {
        padding-right: 0;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .transcription-list li .item-buttons {
        position: static;
        transform: none;
        justify-content: center;
        width: 100%;
        margin-top: 8px;
        gap: 10px;
    }
    
    .transcription-list li {
        padding: 12px;
    }
}

.translate-dropdown {
    position: fixed;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    min-width: 200px;
    transform-origin: top right;
    animation: translateDropdownAppear 0.2s ease-out;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

.translate-dropdown.show {
    display: flex;
    flex-direction: column;
}

.translate-dropdown .dropdown-section-title {
    padding: 8px 12px;
    font-size: 13px;
    color: #444;
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.translate-dropdown .dropdown-options-group {
    display: flex;
    flex-direction: column;
}

.translate-dropdown hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid #eee;
}

.translate-dropdown button {
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.translate-dropdown button:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.translate-dropdown button:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.translate-dropdown button:hover:after {
    left: 100%;
}

.translate-dropdown button.selection-option {
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.7;
}

.translate-dropdown button.selection-option.active {
    color: #2980b9;
    cursor: pointer;
    opacity: 1;
    font-weight: 500;
}

.translate-dropdown button.selection-option.active:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.translate-dropdown .selection-instructions {
    padding: 8px 12px;
    font-size: 12px;
    color: #777;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
    font-style: italic;
}

.translation-result {
    margin-top: 8px;
    padding: 8px 12px;
    padding-right: 55px; /* Make room for buttons */
    background-color: #f5f5f5;
    border-left: 3px solid #4285f4;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    color: #444;
    animation: fadeIn 0.3s ease-in-out;
    position: relative; /* For absolute positioning of buttons */
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    max-width: 100%;
    flex-basis: 100%; /* Take full width in flex container */
    order: 2; /* Display below text content */
}

.result-controls {
    position: absolute;
    right: 5px;
    top: 5px;
    display: flex;
    gap: 5px;
}

.close-translation-btn {
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    padding: 0;
}

.copy-result-btn {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    padding: 0;
}

.copy-result-btn:hover,
.close-translation-btn:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.copy-result-btn.copied {
    background-color: #27ae60;
    color: white;
    animation: copiedAnimation 1.5s 1;
}

@keyframes copiedAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.prompt-result {
    border-left: 3px solid #9b59b6;
}

/* Make list items with results display properly */
.transcription-list li:has(.translation-result[style*="display: block"]) {
    flex-direction: column;
    align-items: flex-start;
}

.transcription-list li:has(.translation-result[style*="display: block"]) .text-content {
    margin-bottom: 0;
}

/* When there are multiple results, show a separator */
.transcription-list li:has(.translation-result[style*="display: block"] + .prompt-result[style*="display: block"]) .translation-result {
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

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

.translating svg {
    animation: pulse 1.5s infinite;
}

.empty-message {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 16px;
    text-align: center;
}

.transcription-list li .prompt-btn {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    color: #9b59b6;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.transcription-list li .prompt-btn:hover {
    background-color: #9b59b6;
    color: white;
    transform: scale(1.1);
}

.transcription-list li .prompt-btn svg {
    width: 14px;
    height: 14px;
}

.generating svg {
    animation: pulse 1.5s infinite;
}

/* Update item buttons gap for the additional button */
.transcription-list li .item-buttons {
    gap: 5px; /* Reduced gap even more for 4 buttons */
}

/* Interactive particles */
.interactive-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 8px 1px rgba(52, 152, 219, 0.8);
}

/* Active recording state - change background animation */
body.active-recording {
    background: linear-gradient(-45deg, #273345, #2c3f57, #c0392b, #e74c3c);
    background-size: 400% 400%;
    animation: gradientAnimation 8s ease infinite;
}

/* Add glow effects for more dynamism */
.record-btn:hover {
    box-shadow: 0 0 15px rgba(255, 75, 75, 0.8), 0 6px 16px rgba(0, 0, 0, 0.3);
}

.record-btn.recording {
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.8), 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Enhanced hover effects for buttons */
.clear-all-btn:hover {
    box-shadow: 0 0 10px rgba(52, 73, 94, 0.8);
    transform: translateY(-2px);
}

.transcription-list li .item-buttons button:hover {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Add a subtle shimmer effect to the container */
@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.03) 50%, 
        rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    pointer-events: none;
    animation: shimmer 5s infinite linear;
    z-index: -1;
}

.purpose-section {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    border-radius: 8px;
    margin: 24px 0;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.purpose-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #9b59b6);
}

.purpose-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    color: #3498db;
}

.purpose-section p {
    margin: 0;
    line-height: 1.5;
    font-size: 15px;
}

.transcription-list li .edit-btn {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    color: #f39c12;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.transcription-list li .edit-btn:hover {
    background-color: #f39c12;
    color: white;
    transform: scale(1.1);
}

.edit-input {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    margin: 8px 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.edit-controls {
    display: flex;
    gap: 10px;
    margin: 8px 0;
    justify-content: flex-end;
}

.edit-save-btn,
.edit-cancel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-save-btn {
    background-color: #27ae60;
    color: white;
}

.edit-save-btn:hover {
    background-color: #2ecc71;
    transform: translateY(-2px);
}

.edit-cancel-btn {
    background-color: #7f8c8d;
    color: white;
}

.edit-cancel-btn:hover {
    background-color: #95a5a6;
    transform: translateY(-2px);
}

.privacy-notice {
    margin-top: 12px;
    padding: 8px 12px;
    background-color: rgba(46, 204, 113, 0.2);
    border-left: 3px solid #2ecc71;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    font-size: 14px;
    animation: fadeIn 0.5s ease-in-out;
}

.privacy-notice svg {
    margin-right: 8px;
    color: #2ecc71;
    flex-shrink: 0;
}

/* Translation Modal Styles */
.translation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Increased z-index to ensure it's above everything */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(3px);
    pointer-events: none; /* Initially disabled pointer events */
}

.translation-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Enable pointer events when shown */
}

.translation-modal {
    background-color: rgba(27, 38, 54, 0.95);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    position: relative; /* Ensure positioning context */
    z-index: 10000; /* Even higher z-index for the modal itself */
}

.translation-modal-overlay.show .translation-modal {
    transform: scale(1);
}

.translation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.translation-modal-title {
    font-size: 18px;
    font-weight: 500;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.translation-modal-title .language-indicator {
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    background-color: rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.translation-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    margin: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.translation-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.translation-modal-content {
    margin-bottom: 15px;
}

.translation-modal-original {
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
}

.translation-modal-result {
    padding: 15px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: white;
    border-left: 3px solid #3498db;
}

.translation-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 0;
}

.translation-modal-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-top-color: #3498db;
    animation: spinner 1s infinite linear;
}

@keyframes spinner {
    100% { transform: rotate(360deg); }
}

.translation-modal-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.translation-modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.translation-modal-copy {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.translation-modal-copy:hover {
    background-color: rgba(52, 152, 219, 0.3);
}

.translation-modal-copy.copied {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.translation-modal-btn.translation-modal-lang {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
    flex: 1;
    margin: 0 5px;
    text-align: center;
    justify-content: center;
}

.translation-modal-btn.translation-modal-lang:hover {
    background-color: rgba(52, 152, 219, 0.3);
}

.translation-modal-btn.translation-modal-lang.selection {
    background-color: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.translation-modal-btn.translation-modal-lang.selection:hover {
    background-color: rgba(155, 89, 182, 0.3);
}

.translation-modal-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.translation-modal-selection-notice {
    padding: 10px 15px;
    background-color: rgba(155, 89, 182, 0.1);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    border-left: 3px solid #9b59b6;
}

.translation-modal-selection-notice .selection-highlight {
    font-weight: 500;
    color: white;
    background-color: rgba(155, 89, 182, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
}

/* Edit mode styling */
.edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: white;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 10px;
    outline: none;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
}

.edit-textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
    background-color: rgba(52, 152, 219, 0.15);
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 8px 0;
}

.save-btn, 
.cancel-btn {
    min-width: 80px;
    height: 36px;
    border-radius: 18px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.save-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.cancel-btn {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    color: white;
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Add icons to buttons */
.save-btn i, 
.cancel-btn i {
    margin-right: 6px;
    font-size: 12px;
}

/* Active/pressed state */
.save-btn:active, 
.cancel-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
} 