/* Asset Library Styles */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: var(--spacing-lg);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background-color: rgba(108, 92, 231, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.assets-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 10px 5px;
    width: 100%;
}

.asset-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.asset-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted);
}

.asset-card .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 71, 87, 0.95);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-card:hover .delete-btn {
    opacity: 1;
}

.asset-card .delete-btn:hover {
    background: rgba(255, 71, 87, 1);
    transform: scale(1.05);
}

.asset-preview {
    width: 100%;
    height: 150px;
    background-color: #000;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.asset-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.asset-name {
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 2px;
}

.sub-assets-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}


/* Upload Preview Styles */
.upload-preview-container {
    margin-top: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: left;
}

.preview-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.preview-icon-wrapper {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-info {
    flex: 1;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-main);
}

.upload-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-success .progress-bar {
    background: var(--accent-secondary);
}

.upload-error .progress-bar {
    background: #ff4757;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    align-items: center;
    height: 20px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

.result-image-container {
    margin: var(--spacing-md) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #000;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image-container img {
    max-width: 100%;
    max-height: 500px;
    display: block;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

/* User Profile Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: auto;
    margin-bottom: 10px;
}

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

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.btn-danger {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 71, 87, 0.2);
}

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 17, 21, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.login-overlay.hidden .login-card {
    transform: translateY(20px);
}

.login-brand {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-brand span {
    color: var(--accent-primary);
}

.login-card h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: white;
    color: #333;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-google img {
    width: 24px;
    height: 24px;
}

/* Chat Actions */
.chat-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.chat-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-yes {
    background: var(--accent-primary);
    color: white;
}

.btn-yes:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-no {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-no:hover {
    background: var(--bg-panel);
    border-color: var(--text-main);
}

.user-message {
    align-self: flex-end;
    background: var(--accent-primary);
    color: white;
    padding: 10px 14px;
    border-radius: 12px 12px 0 12px;
    margin-bottom: 10px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

/* Settings View Styles */
.settings-container {
    animation: fadeIn 0.3s ease;
}

.settings-layout {
    display: flex;
    gap: 20px;
    height: 600px;
}

.settings-sidebar {
    width: 250px;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 10px;
    border: 1px solid var(--border-color);
    overflow-y: auto;
}

.settings-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-sidebar li {
    padding: 12px 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.settings-sidebar li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.settings-sidebar li.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.settings-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

#prompt-template-editor {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 20px;
    border-radius: var(--radius-md);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

#prompt-template-editor:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Generate Button */
.generate-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6c5ce7 0%, #a55eea 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.generate-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.4);
}

.generate-btn:active {
    transform: translateX(-50%) translateY(1px);
}

.generate-btn span {
    font-size: 1.4rem;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.mode-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.mode-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.mode-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-main);
}