* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1d1d1f;
    margin: 0;
}

.header-left p {
    font-size: 1.1rem;
    color: #86868b;
    margin: 5px 0 0 0;
}

.auth-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #1d1d1f;
}

.user-name {
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 2px dashed #0071e3;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #0056b3;
    background-color: #f6f9ff;
}

.upload-area.dragover {
    border-color: #0056b3;
    background-color: #e6f2ff;
}

.upload-content svg {
    margin-bottom: 20px;
    color: #0071e3;
}

.upload-content h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.upload-content p {
    color: #86868b;
}

.editor-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e7;
}

.editor-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.editor-controls {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #0071e3;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.btn-secondary:hover {
    background-color: #e8e8ed;
}

.btn-danger {
    background-color: #ff3b30;
    color: white;
}

.btn-danger:hover {
    background-color: #d70015;
}

.strings-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.string-entry {
    padding: 20px;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    background-color: #fbfbfd;
}

.string-entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.string-entry-header .string-key-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    transition: border-color 0.2s ease;
    font-weight: 500;
}

.string-entry-header .string-key-input:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.comment-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.comment-group label {
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.comment-group input {
    flex: 1;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

.comment-group input:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.string-key {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 1rem;
}

.delete-string-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.string-details {
    display: grid;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 500;
    color: #1d1d1f;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    transition: border-color 0.2s ease;
    margin-bottom: 5px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

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

/* Ensure invite token field has proper layout */
#inviteTokenField {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px;
    margin-bottom: 15px;
}

#inviteTokenField label {
    display: block;
    font-weight: 500;
    color: #1d1d1f;
    font-size: 0.9rem;
}

#inviteTokenField input {
    display: block;
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    transition: border-color 0.2s ease;
    margin-bottom: 5px;
    box-sizing: border-box;
}

/* Shares Management Modal Styles */
.shares-container {
    max-height: 500px;
    overflow-y: auto;
}

.shares-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e7;
}

.shares-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.shares-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
}

.shares-description {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: #6e6e73;
    font-style: italic;
}

.shares-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: #f5f5f7;
    border-radius: 8px;
    border: 1px solid #e5e5e7;
}

.share-info {
    flex: 1;
}

.share-email {
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.share-details {
    font-size: 0.8rem;
    color: #6e6e73;
}

.share-permissions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.permission-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.permission-edit {
    background-color: #e8f4f8;
    color: #0066cc;
}

.permission-view {
    background-color: #f0f0f0;
    color: #666;
}

.share-actions {
    display: flex;
    gap: 8px;
}

.share-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.add-share-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e5e7;
}

.add-share-form .form-group {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: auto;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: #6e6e73;
    font-style: italic;
}

.localizations {
    display: grid;
    gap: 10px;
}

.localization-entry {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #e5e5e7;
}

.localization-entry input {
    margin: 0;
}

.add-localization-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    flex: 1;
    white-space: nowrap;
}

/* Progress Section */
.progress-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.progress-header {
    margin-bottom: 20px;
}

.progress-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.progress-indicators {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-language {
    font-weight: 500;
    color: #1d1d1f;
    font-size: 0.9rem;
}

.progress-percentage {
    font-size: 0.85rem;
    color: #86868b;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-fill.complete {
    background-color: #34c759;
}

.progress-bar-fill.high {
    background-color: #30d158;
}

.progress-bar-fill.medium {
    background-color: #ff9500;
}

.progress-bar-fill.low {
    background-color: #ff3b30;
}

.progress-bar-fill.source {
    background-color: #007aff;
}

@media (max-width: 768px) {
    .progress-indicators {
        grid-template-columns: 1fr;
    }
}

/* AI Progress Section */
.ai-progress-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border-left: 4px solid #007aff;
}

.ai-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ai-progress-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.ai-progress-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-progress-bar {
    height: 8px;
    background-color: #f2f2f7;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.ai-progress-fill {
    height: 100%;
    background-color: #007aff;
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.ai-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.ai-progress-text {
    font-size: 1rem;
    font-weight: 500;
    color: #1d1d1f;
    text-align: center;
}

.ai-progress-details {
    font-size: 0.9rem;
    color: #86868b;
    text-align: center;
    min-height: 20px;
}

/* Filter Section */
.filter-section {
    border-bottom: 1px solid #e5e5e7;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    min-width: 200px;
}

.filter-select:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.filter-status {
    font-size: 0.85rem;
    color: #86868b;
    font-weight: 500;
}

.filter-status.active {
    color: #0071e3;
}

/* String entry visibility states */
.string-entry.filtered-out {
    display: none;
}

.string-entry.has-focused-input {
    display: block !important;
}

@media (max-width: 768px) {
    .filter-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-select {
        min-width: unset;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.button-spacing {
    height: 10px;
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.auth-switch a {
    color: #0071e3;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* OAuth2 Styles */
.oauth2-section {
    margin-top: 20px;
}

.oauth2-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.oauth2-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e5e5e7;
}

.oauth2-divider span {
    background-color: #fff;
    padding: 0 15px;
    color: #86868b;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.oauth2-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oauth2-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    background-color: #fff;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.oauth2-btn:hover {
    border-color: #0071e3;
    background-color: #f6f9ff;
}

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

.oauth2-btn svg,
.oauth2-btn img {
    width: 20px;
    height: 20px;
}

.oauth2-btn.google {
    border-color: #db4437;
    color: #db4437;
}

.oauth2-btn.google:hover {
    background-color: #db4437;
    color: white;
}

.oauth2-btn.github {
    border-color: #333;
    color: #333;
}

.oauth2-btn.github:hover {
    background-color: #333;
    color: white;
}

.oauth2-btn.microsoft {
    border-color: #0078d4;
    color: #0078d4;
}

.oauth2-btn.microsoft:hover {
    background-color: #0078d4;
    color: white;
}

.oauth2-btn.gitlab {
    border-color: #fc6d26;
    color: #fc6d26;
}

.oauth2-btn.gitlab:hover {
    background-color: #fc6d26;
    color: white;
}

/* File Management Styles */
.file-management-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e5e5e7;
    margin-bottom: 30px;
}

.tab-button {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #86868b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-button.active {
    color: #0071e3;
    border-bottom-color: #0071e3;
}

.tab-button:hover {
    color: #0071e3;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.files-list {
    display: grid;
    gap: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    background-color: #fbfbfd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-item:hover {
    border-color: #0071e3;
    background-color: #f6f9ff;
}

.file-item-info {
    flex: 1;
}

.file-item-name {
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 5px;
}

.file-item-meta {
    font-size: 0.8rem;
    color: #86868b;
}

.file-item-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.editor-header-left {
    flex: 1;
}

.file-info {
    font-size: 0.9rem;
    color: #86868b;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .editor-controls {
        justify-content: center;
    }
    
    .localizations {
        grid-template-columns: 1fr;
    }
    
    .localization-entry {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1;
        min-width: 100px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .file-item-actions {
        justify-content: center;
    }
}

/* Notification System */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    cursor: pointer;
    position: relative;
}

.notification.success {
    background-color: #34c759;
}

.notification.error {
    background-color: #ff3b30;
}

.notification.info {
    background-color: #007aff;
}

.notification.warning {
    background-color: #ff9500;
}

.notification .close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions .btn {
    min-width: 80px;
}

/* Confirmation Modal Specific Styling */
#confirmModal .modal-content {
    max-width: 600px;
}

#confirmMessage {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.5;
    max-width: 100%;
}

/* Variation Styles */
.variation-container {
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    background-color: #f9f9fb;
}

.variation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d2d2d7;
}

.variation-type {
    margin-bottom: 15px;
}

.variation-type-header {
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.variation-entry {
    display: grid;
    grid-template-columns: 50px 1fr 100px 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #e5e5e7;
}

.variation-key-input,
.variation-value-input {
    padding: 6px 8px;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    font-size: 0.85rem;
}

.variation-state-select,
.localization-state-select {
    padding: 6px 8px;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    font-size: 0.85rem;
    background-color: #fff;
}

.add-variation-btn {
    margin-top: 8px;
    font-size: 0.8rem;
    padding: 4px 8px;
}

.simple-localization {
    display: grid;
    grid-template-columns: 50px 1fr 100px 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #e5e5e7;
}

.localization-lang-input {
    padding: 6px 8px;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 100%;
    max-width: 50px;
    text-align: center;
}

.localization-value-input {
    padding: 6px 8px;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* AI Features */
.ai-section {
    background-color: #f8f9fa;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.ai-header {
    margin-bottom: 10px;
}

.ai-header h4 {
    margin: 0;
    color: #1d1d1f;
    font-size: 1rem;
}

.ai-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ai-select {
    padding: 6px 10px;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
    min-width: 150px;
}

.ai-btn {
    font-size: 0.8rem;
    padding: 4px 8px;
    margin-left: 5px;
}

.ai-buttons {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.ai-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin: 0 5px;
}

.ai-indicator.ai-good {
    background-color: #34c759;
    color: white;
}

.ai-feedback {
    margin-top: 5px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    border-left: 4px solid;
}

.ai-feedback.ai-wording {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.ai-feedback.ai-issue {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

/* Needs Review State Highlighting */
.localization-entry.needs-review {
    background-color: #fff9e6;
    border-left: 4px solid #ffc107;
}

.localization-entry.needs-review .localization-value-input {
    background-color: #fffbf0;
}

@media (max-width: 768px) {
    .variation-entry,
    .simple-localization {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .variation-entry input,
    .variation-entry select,
    .simple-localization input,
    .simple-localization select {
        font-size: 0.9rem;
    }
    
    .ai-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ai-select {
        min-width: auto;
    }
    
    .ai-buttons {
        justify-content: center;
    }
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-color: #f5f5f7;
    border-top: 1px solid #e5e5e7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 0.8rem;
    z-index: 1000;
    color: #1d1d1f;
}

.status-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.status-center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.status-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.status-ai-operation {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

.status-ai-progress {
    width: 100px;
    height: 4px;
    background-color: #e5e5e7;
    border-radius: 2px;
    overflow: hidden;
}

.status-ai-progress-fill {
    height: 100%;
    background-color: #007aff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.status-counts {
    font-weight: 500;
    color: #86868b;
}

.status-btn {
    padding: 4px 8px;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    background-color: #fff;
    color: #1d1d1f;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.status-btn:hover {
    border-color: #0071e3;
    background-color: #f6f9ff;
}

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

.status-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Add bottom padding to body to prevent content being hidden behind status bar */
body {
    padding-bottom: 30px;
}

@media (max-width: 768px) {
    .status-bar {
        padding: 0 10px;
        font-size: 0.75rem;
    }
    
    .status-ai-operation {
        max-width: 200px;
    }
    
    .status-ai-progress {
        width: 60px;
    }
    
    .status-btn {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
}

/* Modal Z-Index Hierarchy */
#confirmModal {
    z-index: 1100; /* Above version history modal */
}

#inputModal {
    z-index: 1100; /* Above version history modal */
}

#versionHistoryModal {
    z-index: 1000; /* Standard modal level */
}

/* Version History Modal Styles */
.version-history-modal {
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.version-history-content {
    flex: 1;
    overflow-y: auto;
    margin: 20px 0;
}

.version-history-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.version-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.version-stats span {
    font-size: 0.9rem;
    color: #666;
}

.version-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.version-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.version-item:hover {
    background: #f0f0f0;
    border-color: #007aff;
}

.version-item.current-version {
    background: #e6f3ff;
    border-color: #007aff;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.version-info {
    flex: 1;
}

.version-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 5px;
}

.version-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.version-comment {
    font-size: 0.9rem;
    color: #333;
    font-style: italic;
    margin-top: 8px;
}

.version-actions {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.version-actions .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    min-width: auto;
}

.version-history-actions {
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
    text-align: right;
}

.version-size {
    font-size: 0.8rem;
    color: #999;
}

.version-preview {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-top: 10px;
}

.version-preview.expanded {
    max-height: 300px;
    padding: 10px;
}

.version-preview pre {
    font-size: 0.8rem;
    color: #333;
    white-space: pre-wrap;
    margin: 0;
}

@media (max-width: 768px) {
    .version-history-modal {
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .version-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .version-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .version-actions {
        align-self: flex-end;
    }
}

/* Upload Version Modal */
.upload-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.file-info {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

.file-info.valid {
    color: #28a745;
}

.file-info.invalid {
    color: #dc3545;
}

#uploadVersionModal .modal-content {
    max-width: 500px;
}

#uploadVersionModal textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

#uploadVersionModal input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
}

#uploadVersionModal input[type="file"]:hover {
    border-color: #007bff;
    background: #f0f7ff;
}

#uploadVersionModal input[type="file"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Presigned URL Modal */
#presignedUrlModal .modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.presigned-url-form {
    margin: 20px 0;
}

.form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.generated-url-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.url-info h4 {
    color: #28a745;
    margin-bottom: 15px;
}

.url-box {
    margin-bottom: 20px;
}

.url-field {
    display: flex;
    gap: 10px;
    align-items: center;
}

.url-field input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    background: #fff;
}

.url-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.detail-item {
    font-size: 0.9rem;
}

.usage-instructions h5 {
    margin-bottom: 10px;
    color: #495057;
}

.code-block {
    position: relative;
    background: #2d3748;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.code-block pre {
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.4;
}

.code-block button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 0.75rem;
}

.existing-urls-section {
    margin-top: 30px;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.urls-list {
    max-height: 200px;
    overflow-y: auto;
}

.url-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.url-item.expired {
    opacity: 0.6;
    background: #fff3cd;
    border-color: #ffeaa7;
}

.url-item.used {
    opacity: 0.6;
    background: #d1ecf1;
    border-color: #bee5eb;
}

.url-item-info {
    flex: 1;
}

.url-item-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.url-item-details {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.url-item-actions {
    display: flex;
    gap: 5px;
}

.url-item-actions .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    #presignedUrlModal .modal-content {
        max-width: 95vw;
        margin: 10px;
    }
    
    .url-details {
        grid-template-columns: 1fr;
    }
    
    .url-field {
        flex-direction: column;
        align-items: stretch;
    }
    
    .url-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .url-item-actions {
        justify-content: flex-end;
    }
}

/* Invite Management Styles */
.invites-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invite-item {
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.invite-info {
    flex: 1;
}

.invite-email {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.invite-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: #86868b;
    margin-bottom: 8px;
}

.invite-status {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.invite-status.status-active {
    background-color: #d1f2eb;
    color: #00875a;
}

.invite-status.status-used {
    background-color: #e3f2fd;
    color: #1976d2;
}

.invite-status.status-expired {
    background-color: #ffebee;
    color: #d32f2f;
}

.invite-url {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background-color: #f6f6f6;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
    word-break: break-all;
}

.invite-actions {
    display: flex;
    gap: 8px;
}

.no-items {
    text-align: center;
    padding: 40px 20px;
    color: #86868b;
    font-style: italic;
}

@media (max-width: 768px) {
    .invite-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .invite-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .invite-actions {
        justify-content: flex-end;
    }
}