/* pack_editor.css - Стили для редактора пачек */
/* v1.3.0 - 22.11.2025 00:20 (Загрузка фотографий на Drive) */

/* ═══════════════════════════════════════════════════════════
   ОБЩИЕ СТИЛИ
   ═══════════════════════════════════════════════════════════ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */

.pack-editor-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.header-left h1 {
    font-size: 24px;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: #999;
}

.search-box input {
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.stats-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f0f4ff;
    border-radius: 8px;
    color: #667eea;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */

.pack-editor-main {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    min-height: calc(100vh - 250px);
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

/* Skeleton Loaders */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-photo {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.empty-state i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════
   PACKS GRID
   ═══════════════════════════════════════════════════════════ */

.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

/* Pack Card */
.pack-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.pack-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.pack-card.editing {
    border: 2px solid #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

/* Pack Header */
.pack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.pack-id {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.edit-button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.edit-button:hover {
    transform: scale(1.05);
}

.edit-button.cancel {
    background: #dc3545;
}

/* Pack Fields */
.pack-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-value {
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.field-value.editing {
    border-color: #667eea;
    background: white;
    outline: none;
}

.field-value.editing:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Pack Photos */
.pack-photos {
    margin-top: 20px;
}

.photos-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.photo-slot {
    aspect-ratio: 1;
    border: 2px dashed #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    transition: all 0.3s;
}

.photo-slot.has-photo {
    border-style: solid;
    border-color: #667eea;
}

.photo-slot.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.photo-slot.drag-over {
    border-color: #28a745;
    background: #d4edda;
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: move;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

.photo-image.loading {
    animation: shimmer 1.5s infinite;
}

.photo-image.loaded {
    animation: none;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 14px;
}

.photo-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-slot:hover .photo-controls {
    opacity: 1;
}

.photo-delete {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.photo-delete:hover {
    transform: scale(1.1);
    background: rgba(220, 53, 69, 1);
}

.photo-index {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Save Button */
.save-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: none;
}

.pack-card.editing .save-button {
    display: block;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.save-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.pack-editor-footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    text-align: center;
    margin-top: 40px;
}

.version-info {
    color: white;
    font-size: 14px;
    opacity: 0.9;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .search-box input {
        width: 100%;
    }

    .packs-grid {
        grid-template-columns: 1fr;
    }

    .pack-fields {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

.notification.success {
    border-left: 4px solid #28a745;
}

.notification.error {
    border-left: 4px solid #dc3545;
}

.notification.info {
    border-left: 4px solid #667eea;
}

.notification i {
    font-size: 20px;
}

.notification.success i {
    color: #28a745;
}

.notification.error i {
    color: #dc3545;
}

.notification.info i {
    color: #667eea;
}

/* ═══════════════════════════════════════════════════════════
   ФОТО МОДАЛЬНОЕ ОКНО
   ═══════════════════════════════════════════════════════════ */

.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

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

.photo-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.photo-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.photo-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.photo-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.photo-modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

/* Слоты редактирования фото */
.photo-edit-slot {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    background: #f8f9fa;
    transition: all 0.3s;
}

.photo-edit-slot:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.photo-edit-header {
    margin-bottom: 15px;
}

.photo-edit-label {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.photo-edit-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background: white;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.photo-edit-preview .photo-placeholder {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.photo-edit-preview .photo-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.photo-edit-controls {
    display: flex;
    gap: 10px;
}

.photo-edit-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.photo-upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.photo-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.photo-delete-btn {
    background: #dc3545;
    color: white;
}

.photo-delete-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.photo-delete-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Прогресс загрузки */
.photo-upload-progress {
    margin-top: 15px;
    text-align: center;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    animation: progressAnimation 1.5s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    50% { width: 50%; }
    100% { width: 100%; }
}

.progress-text {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

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

.photo-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.photo-cancel-btn {
    background: #6c757d;
    color: white;
}

.photo-cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.photo-save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.photo-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.photo-save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Кнопка "Фото" в карточке */
.photo-manager-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    margin-left: auto;
}

.photo-manager-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(32, 201, 151, 0.4);
}

/* Responsive для модалки */
@media (max-width: 768px) {
    .photo-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .photo-modal-header {
        border-radius: 0;
    }
    
    .photo-modal-body {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .photo-modal-footer {
        flex-direction: column;
    }
    
    .photo-modal-btn {
        width: 100%;
        justify-content: center;
    }
}

