/* RedStar Studio - AI Image Generation Platform */
:root {
    --red-primary: #dc3545;
    --red-primary-light: #e57985;
    --red-dark: #c82333;
    --red-light: #f5c6cb;
    --gray-light: #f8f9fa;
    --gray-medium: #6c757d;
    --gray-dark: #343a40;
    --white: #ffffff;
    --black: #000000;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

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

html {
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-light);
    color: var(--gray-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Header */
.redstar-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    position: relative;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 200px;
    height: 60px;
    line-height: 60px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}

.header-logo {
    height: 36px;
    width: auto;
}

.user-circle {
    width: 36px;
    height: 36px;
    background: var(--red-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.user-initial {
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
    min-width: 200px;
    justify-content: flex-end;
}

.usage-info {
    font-size: 12px;
    color: var(--gray-medium);
    white-space: nowrap;
    font-weight: 500;
}

.logout-btn {
    background: var(--red-primary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: var(--red-dark);
}

/* Main Content */
.redstar-main {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 24px;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    display: flex;
    gap: 24px;
    min-height: fit-content;
    max-width: 100%;
    overflow-x: hidden;
}

/* Left Sidebar - White Rounded Container */
.left-sidebar {
    width: 35%;
    min-width: 350px;
    max-width: 500px;
    background: var(--white);
    flex-shrink: 0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    min-height: fit-content;
    height: auto;
}

/* Tab Bar - Inside Left Container */
.tab-bar {
    display: none;
}

.left-sidebar .tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.left-sidebar .tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    color: var(--gray-medium);
    flex: 1;
    text-align: center;
}

.left-sidebar .tab-btn.active {
    color: var(--red-primary);
    border-bottom-color: var(--red-primary);
}

.left-sidebar .tab-btn:hover {
    color: var(--red-primary);
}

.tab-content {
    display: none;
}

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

.input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: fit-content;
}

.input-section label {
    font-weight: 600;
    color: var(--gray-dark);
    font-size: 14px;
}

.input-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.input-section textarea:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.input-section select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

.input-section select:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.image-count-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
}

.generate-btn {
    background: var(--red-primary);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.generate-btn:hover {
    background: var(--red-dark);
}

.generate-btn:disabled {
    background: var(--gray-medium);
    cursor: not-allowed;
}

/* File Upload */
.file-upload-wrapper {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
    position: relative;
}

.file-upload-wrapper:hover {
    border-color: var(--red-primary);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-text {
    color: var(--gray-medium);
    font-size: 14px;
}

.file-upload-text small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
}

/* Image Preview */
.image-preview {
    position: relative;
    margin-top: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.remove-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gallery Area - White Rounded Container */
.gallery-area {
    width: 65%;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-height: 400px;
    height: auto;
    min-width: 0;
    overflow: visible;
}

.gallery-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border-radius: 12px 12px 0 0;
}

.gallery-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-dark);
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Switch Design */
.view-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 12px;
    color: var(--gray-medium);
    margin: 0;
}

.view-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--border);
    border: none;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.view-toggle:hover {
    background: var(--red-primary-light);
}

.view-toggle.active {
    background: var(--red-primary);
}

.view-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    z-index: 2;
}

.view-toggle.active::before {
    transform: translateX(24px);
}

.clear-all-btn {
    background: none;
    border: 1px solid var(--red-primary);
    color: var(--red-primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-all-btn:hover {
    background: var(--red-primary);
    color: var(--white);
}

/* Gallery Content */
.gallery-content {
    flex: 1;
    padding: 24px;
    min-height: fit-content;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    height: auto;
}

.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    text-align: center;
    color: var(--gray-medium);
}

.gallery-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Gallery List View */
.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: fit-content;
    height: auto;
    max-width: 100%;
    overflow-x: hidden;
}

.gallery-item {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
}

.gallery-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-item-content {
    padding: 16px;
}

.gallery-item-prompt {
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 12px;
    font-style: italic;
}

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

/* Gallery Image Elements */
.gallery-image {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    transition: transform 0.2s ease;
    max-width: 100%;
    overflow: visible;
    height: auto;
}

.gallery-image:hover {
    transform: translateY(-2px);
}

.gallery-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 12px;
    display: block;
}

.gallery-image-info {
    max-width: 100%;
    overflow: hidden;
}

.gallery-image-prompt {
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 12px;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.gallery-image-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 100%;
}

.gallery-image-actions button {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-dark);
    height: auto;
    min-height: unset;
}

.gallery-image-actions button:hover {
    background: var(--gray-light);
    border-color: var(--red-primary);
    color: var(--red-primary);
}

.gallery-image-actions button img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.gallery-image-actions button:hover img {
    opacity: 1;
}

.action-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    background: var(--gray-light);
}

.action-btn img {
    width: 12px;
    height: 12px;
}

/* Gallery Thumbnail View */
.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    min-height: fit-content;
    height: auto;
}

.thumbnail-item {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.thumbnail-item:hover {
    transform: scale(1.02);
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 12px 8px 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumbnail-item:hover .thumbnail-overlay {
    opacity: 1;
}

.thumbnail-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.thumbnail-action {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.thumbnail-action:hover {
    background: var(--white);
}

.thumbnail-action img {
    width: 14px;
    height: 14px;
}

/* Combine Tab Thumbnail Grid */
.combine-previews {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.combine-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-light);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.combine-preview-item:hover {
    transform: scale(1.05);
}

.combine-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.combine-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: var(--white);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.combine-preview-remove:hover {
    background: var(--red-primary);
}

/* Image Preview Modal */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.image-preview-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius);
}

.image-preview-modal .close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Info Section */
.info-section {
    background: var(--gray-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 8px;
}

.info-section small {
    color: var(--gray-medium);
    font-size: 12px;
    line-height: 1.4;
}

/* Reference Buttons */
.reference-btn {
    background: var(--gray-light);
    border: 1px solid var(--border);
    padding: 6px 12px;
    margin: 4px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reference-btn:hover {
    background: var(--red-light);
    border-color: var(--red-primary);
}

.image-references {
    margin-top: 12px;
    padding: 12px;
    background: var(--gray-light);
    border-radius: var(--radius);
}

.reference-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--gray-medium);
    width: 100%;
    text-align: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--red-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

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

/* Error Overlay */
.error-overlay {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--red-primary);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    max-width: 400px;
    text-align: center;
}

/* Footer */
.redstar-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--gray-medium);
}

.version {
    font-family: monospace;
    color: var(--red-primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .left-sidebar {
        width: 40%;
        min-width: 320px;
    }
    
    .gallery-area {
        width: 60%;
    }
}

@media (max-width: 900px) {
    .left-sidebar {
        width: 45%;
        min-width: 300px;
    }
    
    .gallery-area {
        width: 55%;
    }
}

@media (max-width: 768px) {
    .redstar-main {
        padding: 16px;
        gap: 16px;
    }
    
    .content-wrapper {
        flex-direction: column;
        gap: 16px;
    }
    
    .left-sidebar {
        width: 100%;
        min-width: unset;
    }
    
    .gallery-area {
        width: 100%;
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .header-right .usage-info {
        display: none;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 8px;
    }
}

/* Comparison Modal Styles */
.comparison-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comparison-modal-overlay.show {
    opacity: 1;
}

.comparison-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.comparison-modal-overlay.fullscreen .comparison-modal-content {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.9);
}

.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 65px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.comparison-images {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: #f5f5f5;
    overflow: hidden;
}

.edited-image,
.original-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.comparison-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--red-primary);
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--red-primary);
    color: var(--white);
    padding: 8px 4px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    user-select: none;
}

.comparison-bottom-bar {
    padding: 15px;
    background: var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.label-left,
.label-right,
.label-center {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-dark);
}

.label-center {
    font-style: italic;
    color: var(--gray-medium);
}

.thumbnail-selector {
    padding: 15px;
    background: var(--gray-light);
    border-top: 1px solid var(--border);
}

.thumbnail-selector h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--gray-dark);
}

.thumbnail-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--white);
}

.thumbnail-option:hover {
    border-color: var(--red-light);
    background: var(--red-light);
}

.thumbnail-option.active {
    border-color: var(--red-primary);
    background: var(--red-light);
}

.thumbnail-option img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4px;
}

.thumbnail-option span {
    font-size: 12px;
    text-align: center;
    color: var(--gray-dark);
    font-weight: 500;
    line-height: 1.2;
}

.thumbnail-option.active span {
    color: var(--red-primary);
    font-weight: 600;
}

/* Hamburger Menu */
.hamburger-menu {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray-dark);
    padding: 8px;
    margin-right: 12px;
}

.hamburger-menu:hover {
    background: var(--gray-light);
    border-radius: 4px;
}

/* Navigation Menu */
.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.nav-menu.active {
    visibility: visible;
    opacity: 1;
}

.nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: var(--white);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-menu.active .nav-content {
    transform: translateX(0);
}

.nav-header {
    padding: 20px;
    background: var(--red-primary);
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 32px;
    height: 32px;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: bold;
    flex: 1;
}

.nav-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

.nav-links {
    list-style: none;
    padding: 0;
}

.nav-links li {
    border-bottom: 1px solid var(--border);
}

.nav-link {
    display: block;
    padding: 16px 20px;
    color: var(--gray-dark);
    text-decoration: none;
    transition: background 0.2s ease;
}

.nav-link:hover {
    background: var(--gray-light);
}

.nav-link.active {
    background: var(--red-light);
    color: var(--red-primary);
    font-weight: 500;
}

/* Page System */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Settings and About Pages */
.settings-container,
.about-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.settings-section,
.about-section {
    margin-bottom: 2rem;
}

.settings-section h3,
.about-section h3 {
    color: var(--red-primary);
    margin-bottom: 1rem;
}

.usage-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-weight: bold;
    color: var(--gray-medium);
}

.stat-value {
    font-size: 1.2rem;
    color: var(--red-primary);
}

.about-section ul {
    list-style: none;
    padding: 0;
}

.about-section ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.about-section ul li:before {
    content: "✓ ";
    color: var(--red-primary);
    font-weight: bold;
}

/* API Configuration Styles */
.api-config {
    margin-top: 1rem;
}

.api-config label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-dark);
}

.token-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.token-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.9rem;
    background: var(--gray-light);
}

.token-input:focus {
    outline: none;
    border-color: var(--red-primary);
    background: var(--white);
}

.token-input[readonly] {
    background: var(--gray-light);
    cursor: not-allowed;
}

.edit-token-btn,
.save-token-btn,
.cancel-token-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.edit-token-btn {
    background: var(--white);
    color: var(--gray-dark);
}

.edit-token-btn:hover {
    background: var(--gray-light);
}

.save-token-btn {
    background: var(--red-primary);
    color: var(--white);
    border-color: var(--red-primary);
}

.save-token-btn:hover {
    background: var(--red-dark);
}

.cancel-token-btn {
    background: var(--white);
    color: var(--gray-medium);
}

.cancel-token-btn:hover {
    background: var(--gray-light);
}

.token-help {
    color: var(--gray-medium);
    font-size: 0.85rem;
    font-style: italic;
}