/* Стили для личного кабинета */

.dashboard-main {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 40px 0;
}

/* Header пользователя */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.username {
    color: white;
    font-weight: 600;
}

.credits {
    background: rgba(255, 217, 61, 0.2);
    color: #ffd93d;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Dashboard Header */
.dashboard-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
    justify-items: start;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.user-welcome h1 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 2rem;
}

.user-welcome p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

/* Адаптивность для dashboard-header */
@media (max-width: 1024px) {
    .dashboard-header {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .user-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 20px;
    }
    
    .user-stats {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .stat-card {
        min-width: 200px;
        justify-content: center;
    }
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Карточка кредитов с кнопкой */
.credits-card {
    position: relative;
    padding-bottom: 60px;
}

.credits-card .buy-credits-btn {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.credits-card .buy-credits-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.credits-card .buy-credits-btn .icon {
    font-size: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Tabs */
.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.tab-btn.active i {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.tab-header h2 {
    margin: 0;
    color: var(--text-primary);
}

/* Animations */
.animations-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.animations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.animation-card {
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.animation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.animation-preview {
    position: relative;
    height: 200px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.animation-preview img,
.animation-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Иконка воспроизведения для превью */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    transition: all 0.3s ease;
    pointer-events: none;
}

.animation-card:hover .play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.animation-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
}

.status-processing {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.animation-info {
    padding: 20px;
}

.animation-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.animation-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.animation-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: 2px solid rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Profile */
.profile-section {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: start;
}

.profile-card {
    display: flex;
    gap: 30px;
    align-items: center;
}

.profile-avatar {
    position: relative;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-upload-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.profile-info h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.profile-info p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
}

.profile-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-stat i {
    color: var(--primary-color);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Billing */
.billing-section {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.credits-overview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.credits-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.credits-icon {
    font-size: 3rem;
}

.credits-balance {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.credits-label {
    font-size: 1.1rem;
    opacity: 0.8;
}

.pricing-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 10px;
}

.price {
    font-weight: 600;
    color: var(--primary-color);
}

/* Loading & Empty States */
.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

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

.modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.animation-info {
    margin-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.info-row:last-child {
    border-bottom: none;
}

/* Модальное окно предпросмотра анимации */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden; /* Предотвращаем появление скроллбара */
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: none;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

/* Красивый скроллбар для modal-body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin: 10px 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Убираем стрелочки скроллбара */
.modal-body::-webkit-scrollbar-button {
    display: none;
}

.modal-body::-webkit-scrollbar-corner {
    background: transparent;
}

/* Для Firefox */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #667eea rgba(0, 0, 0, 0.05);
}

.preview-modal {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Заполняем углы модального окна градиентом */
.modal-header::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px 20px 0 0;
    z-index: -1;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

.video-container {
    margin-bottom: 25px;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.video-container video {
    width: 100%;
    max-height: 70vh;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.animation-details {
    background: #f8fafc;
    border-radius: 15px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

.detail-value {
    font-weight: 700;
    color: #1f2937;
    font-size: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-footer {
    display: flex;
    gap: 15px;
    padding: 25px 30px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
    justify-content: flex-end;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .user-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .animations-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .animations-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-section {
        grid-template-columns: 1fr;
    }
    
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
    
    .credits-overview {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Create Animation Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex !important;
}

.animation-modal {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 20px;
    box-shadow: none;
}

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

.modal-header h2 {
    margin: 0;
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.modal-body {
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e0e7ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 15px;
}

.upload-text p {
    margin: 0 0 10px 0;
    color: #475569;
    font-size: 1rem;
}

.upload-link {
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
}

.upload-link:hover {
    text-decoration: underline;
}

.upload-text small {
    color: #64748b;
    font-size: 0.85rem;
}

/* Photo Preview */
.photo-preview {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    max-width: 400px;
    max-height: 300px;
    margin: 20px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-preview img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 15px;
}

.remove-photo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    z-index: 10;
}

.remove-photo-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #374151;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Cost Section */
.cost-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #c7d2fe;
}

.cost-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.cost-item span:first-child {
    color: #475569;
    font-weight: 500;
}

.cost-value {
    color: #1e293b;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 30px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modal-footer .btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-footer .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.modal-footer .btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.modal-footer .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.modal-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .animation-modal {
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Модальное окно предпросмотра на мобильных */
    .preview-modal {
        width: 95%;
        margin: 10px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px 0;
    }
    
    .detail-label {
        font-size: 0.9rem;
        color: #4b5563;
    }
    
    .detail-value {
        font-size: 1rem;
        font-weight: 800;
        color: #1f2937;
    }
}

/* Принудительное переопределение фона и теней модального окна */
.modal,
.modal-overlay,
#modal-overlay,
#animation-modal {
    background: transparent !important;
}

.modal-content,
.animation-modal,
.preview-modal {
    box-shadow: none !important;
    /* Раскомментируйте следующую строку, чтобы убрать закругленные углы */
    /* border-radius: 0 !important; */
}

.modal::before,
.modal-overlay::before {
    display: none !important;
}

/* МАКСИМАЛЬНЫЙ ПРИОРИТЕТ - УБИРАЕМ ТЕНИ МОДАЛЬНОГО ОКНА */

.modal *,
.modal-content *,
.animation-modal *,
.preview-modal *,
#animation-modal *,
#modal-overlay * {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

/* Убираем все возможные тени и эффекты */
.modal,
.modal *,
.modal-content,
.modal-content *,
.animation-modal,
.animation-modal *,
.preview-modal,
.preview-modal *,
#animation-modal,
#animation-modal *,
#modal-overlay,
#modal-overlay * {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    outline: none !important;
    text-shadow: none !important;
}

/* Отключаем все возможные эффекты браузера и добавляем четкую рамку */
.modal-content {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    filter: drop-shadow(0 0 0 transparent) !important;
    -webkit-filter: drop-shadow(0 0 0 transparent) !important;
    border: 3px solid #667eea !important;
}

/* Дополнительная рамка для предпросмотра */
.preview-modal {
    border: 4px solid #667eea !important;
    outline: 2px solid #764ba2 !important;
    outline-offset: 2px !important;
}

/* Рамка для animation-modal */
.animation-modal {
    border: 3px solid #667eea !important;
    outline: 1px solid #764ba2 !important;
    outline-offset: 1px !important;
}

/* Стили для модального окна предпросмотра анимации */
.animation-video-container {
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
}

.animation-video-container video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: #000;
}

.animation-info-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.info-label {
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

.info-value {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1rem;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 30px 30px;
    border-top: 1px solid #e2e8f0;
}

.modal-footer .btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.modal-footer .btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.modal-footer .btn-secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Адаптивность для модального окна анимации */
@media (max-width: 768px) {
    .animation-modal {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Исправления для модального окна обработки фото */

/* Отключаем скроллбар основной страницы при открытом модальном окне */
body.modal-open {
    overflow: hidden !important;
}

/* Правильные стили для modal-body */
.modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    max-height: calc(90vh - 100px) !important;
}

/* ===================================
   DARK THEME SUPPORT
   =================================== */

[data-theme="dark"] .dashboard-main {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .dashboard-header {
    background: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .user-welcome h1 {
    color: var(--text-primary);
}

[data-theme="dark"] .user-welcome p {
    color: var(--text-secondary);
}

[data-theme="dark"] .dashboard-tabs {
    background: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .tab-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .tab-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
    transform: translateY(-2px);
}

[data-theme="dark"] .tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}

[data-theme="dark"] .tab-content {
    background: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .tab-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .tab-header h2 {
    color: var(--text-primary);
}

[data-theme="dark"] .animations-filters {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .filter-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .filter-group select {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .animation-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .animation-preview {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .no-preview {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .animation-title {
    color: var(--text-primary);
}

[data-theme="dark"] .animation-details {
    color: var(--text-secondary);
}

[data-theme="dark"] .action-btn {
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .animation-modal,
[data-theme="dark"] .preview-modal {
    background: var(--card-bg);
    border-color: var(--primary-color) !important;
}

[data-theme="dark"] .modal-header h2,
[data-theme="dark"] .modal-header h3 {
    color: white;
}

[data-theme="dark"] .modal-body {
    background: var(--card-bg);
}

[data-theme="dark"] .modal-footer {
    background: var(--bg-tertiary);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .form-group select {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .upload-area {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .upload-text p {
    color: var(--text-secondary);
}

[data-theme="dark"] .cost-section {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .cost-item span:first-child {
    color: var(--text-secondary);
}

[data-theme="dark"] .cost-value {
    color: var(--text-primary);
}

[data-theme="dark"] .animation-details {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .detail-label {
    color: var(--text-primary);
}

[data-theme="dark"] .detail-value {
    color: var(--text-primary);
}

[data-theme="dark"] .info-item {
    background: var(--bg-tertiary);
    border-left-color: var(--primary-color);
}

[data-theme="dark"] .info-label {
    color: var(--text-primary);
}

[data-theme="dark"] .info-value {
    color: var(--text-primary);
}

[data-theme="dark"] .empty-state {
    color: var(--text-secondary);
}

[data-theme="dark"] .empty-state h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .profile-card {
    border: none !important;
}

[data-theme="dark"] .profile-info {
    border: none !important;
}

[data-theme="dark"] .profile-info h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .profile-info p {
    color: var(--text-secondary);
}

[data-theme="dark"] .profile-stat {
    color: var(--text-secondary);
}

[data-theme="dark"] .avatar-upload-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .avatar-upload-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   ОПТИМИЗАЦИЯ ЗАГРУЗКИ ВИДЕО В МОДАЛЬНОМ ОКНЕ
   ============================================ */

/* Индикатор загрузки для видео в модальном окне */
.modal-body video.loading {
    position: relative;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    min-height: 300px;
}

.modal-body video.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color, #6366f1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.modal-body video.error {
    background: #fee;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.modal-body video.error::before {
    content: '❌ Ошибка загрузки видео';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc2626;
    font-size: 1rem;
    font-weight: 600;
}

/* Темная тема для индикаторов */
[data-theme="dark"] .modal-body video.loading {
    background: linear-gradient(90deg, #2d3748 25%, #1a202c 50%, #2d3748 75%);
    background-size: 200% 100%;
}

[data-theme="dark"] .modal-body video.error {
    background: #4a1a1a;
}


