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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #ffffff;
}

header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h1 {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.2rem;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 100px);
}

.sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
}

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

.sidebar li {
    margin-bottom: 0.3rem;
}

.sidebar a {
    display: block;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    color: #ffffff;
    background: rgba(0, 212, 255, 0.1);
}

.sidebar a.active {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.15);
    border-left-color: #00d4ff;
}

main {
    flex: 1;
    max-width: 900px;
    margin: 2rem;
    margin-left: 0;
    padding: 0 2rem;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.model-selector label {
    font-weight: 600;
}

.model-selector select {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
}

.model-selector select option {
    background: #1a1a2e;
    color: #ffffff;
}

.tab-content {
    display: none;
}

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

.tab-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.description {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
}

.generate-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group select option {
    background: #1a1a2e;
    color: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d4ff;
}

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

.form-group input[type="range"] {
    padding: 0;
    cursor: pointer;
}

.range-value {
    display: inline-block;
    margin-left: 0.5rem;
    color: #00d4ff;
    font-weight: 600;
}

.upload-area,
.upload-area-multiple {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area-multiple:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.preview-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

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

.image-index {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.remove-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(255, 0, 0, 0.8);
    color: #ffffff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-item:hover {
    border-color: #00d4ff;
    transform: scale(1.02);
}

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

.image-number {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.image-preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1001;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-count {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.result-panel {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
}

.result-panel.hidden {
    display: none;
}

.result-panel h3 {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    width: 0%;
    transition: width 0.3s ease;
}

.status-text {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.video-container {
    margin-top: 1rem;
}

.video-container video {
    width: 100%;
    border-radius: 8px;
}

.image-container {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.image-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.download-link {
    display: block;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
}

.download-link:hover {
    background: rgba(0, 212, 255, 0.3);
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.user-section, .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    gap: 0.5rem;
}

.user-info .username {
    font-weight: bold;
    color: #00d4ff;
}

.user-info .credits {
    background: rgba(255, 215, 0, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.modal .close:hover {
    color: #ffffff;
}

.modal-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    color: #ffffff;
}

.modal-form {
    display: block;
}

.modal-form.hidden {
    display: none;
}

.modal-form h3 {
    margin-bottom: 1rem;
}

.error-message {
    color: #ff4444;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.thumbnail-container {
    margin-top: 1rem;
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.thumbnail-container:hover {
    border-color: #00d4ff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

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

.thumbnail {
    max-width: 200px;
    max-height: 150px;
    display: block;
    object-fit: cover;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #ffffff;
    font-size: 0.85rem;
}

.preview-icon {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.image-preview-modal .preview-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.image-preview-modal img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-preview-modal .close-preview {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2rem;
    color: #ffffff;
    cursor: pointer;
    background: none;
    border: none;
}

.image-preview-modal .close-preview:hover {
    color: #00d4ff;
}

.thumbnail-container.hidden {
    display: none;
}

.btn-admin {
    background: linear-gradient(90deg, #ff6b6b, #ffa500);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

.btn-admin:hover {
    background: linear-gradient(90deg, #ff5252, #ff8c00);
}

.admin-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.admin-modal h3 {
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-panel {
    max-height: 400px;
    overflow-y: auto;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-item .user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-item .user-name {
    font-weight: bold;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-item .user-email {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.user-item .user-credits {
    color: #ffd700;
    font-size: 0.9rem;
}

.user-item .user-status {
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-approved {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-rejected {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-approve {
    background: #4caf50;
    color: #ffffff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-approve:hover {
    background: #45a049;
}

.btn-reject {
    background: #f44336;
    color: #ffffff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-reject:hover {
    background: #d32f2f;
}

.user-credits-edit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-credits-edit label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.user-credits-edit input {
    width: 80px;
    padding: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-save {
    background: #2196f3;
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}

.btn-save:hover {
    background: #1976d2;
}

.admin-badge {
    background: linear-gradient(90deg, #ffd700, #ff6b6b);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.empty-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 2rem;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .user-section, .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-actions, .user-credits-edit {
        width: 100%;
        justify-content: flex-start;
    }
}