/* Основные стили (светлая тема по умолчанию) */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-color-secondary: #666666;
    --card-bg: #ffffff;
    --border-color: #e5e5e5;
    --button-bg: #f0f0f0;
    --button-hover: #e5e5e5;
}

/* Темная тема */
[data-theme='dark'] {
    --bg-color: #000000;
    --text-color: #ffffff;
    --text-color-secondary: #999999;
    --card-bg: #000000;
    --border-color: #333333;
    --button-bg: #1a1a1a;
    --button-hover: #2d2d2d;
}

.album-detail {
    padding: 0;
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-color);
}

.album-header {
    padding: 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    margin: 0;
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.header-item {
    font-size: 14px;
    color: var(--text-color);
}

.header-item .label {
    font-weight: normal;
    color: var(--text-color-secondary);
}

.header-item .value {
    margin-left: 5px;
    color: var(--text-color);
}

.actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 2rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    margin-top: -1px;
}

.download-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    background: var(--button-bg);
    color: var(--text-color);
    transition: background 0.2s ease;
}

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

.action-button i {
    font-size: 14px;
    color: var(--text-color);
}

.action-button .counter {
    color: var(--text-color-secondary);
    font-size: 14px;
}

.share-btn {
    width: 40px;
    padding: 0;
    justify-content: center;
    background: var(--button-bg);
}

.share-btn:hover {
    background: var(--button-hover);
}

.total-photos {
    font-size: 14px;
    color: var(--text-color-secondary);
}

/* Адаптивность */
@media (max-width: 1200px) {
    .header-info {
        padding: 0 1rem;
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .album-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg-color);
        padding: 8px;
    }

    .header-info {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .header-item {
        font-size: 12px;
        padding: 4px 8px;
        background: var(--button-bg);
        border-radius: 6px;
    }

    /* Галерея */
    .photos-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
        padding: 1px;
        padding-bottom: 65px;
        background: var(--border-color);
    }

    .photo-item {
        position: relative;
        aspect-ratio: 1;
        touch-action: manipulation;
    }

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

    /* Кнопки быстрых действий на фото */
    .photo-quick-actions {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-between;
        padding: 8px;
        background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    }

    .quick-action-btn {
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.9);
        color: #333;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quick-action-btn i {
        font-size: 16px;
    }

    /* Индикатор выбора */
    .select-indicator {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 24px;
        height: 24px;
        border: 2px solid rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.3);
    }

    .photo-item.selected .select-indicator {
        background: #4CAF50;
        border-color: #4CAF50;
    }

    .select-indicator::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 12px;
        height: 12px;
        background: white;
        border-radius: 50%;
        opacity: 0;
    }

    .photo-item.selected .select-indicator::after {
        opacity: 1;
    }

    /* Нижняя панель */
    .actions-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: var(--bg-color);
        padding: 8px;
        border-top: 1px solid var(--border-color);
    }

    .download-actions {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        gap: 8px;
        width: 100%;
    }

    .action-button {
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
        border-radius: 6px;
    }

    .share-btn {
        width: 40px;
    }

    .total-photos {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-item {
        font-size: 12px;
        padding: 4px 10px;
    }

    .action-button {
        font-size: 12px;
        height: 40px;
    }

    .action-button i {
        font-size: 14px;
    }

    .share-btn {
        width: 40px;
    }

    .photo-action-btn {
        width: 32px;
        height: 32px;
    }

    .photo-action-btn i {
        font-size: 14px;
    }
}

/* Ориентация landscape */
@media (max-width: 896px) and (orientation: landscape) {
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
        padding-bottom: 55px;
    }

    .actions-bar {
        padding: 6px 8px;
    }

    .action-button {
        height: 36px;
    }
}

/* Поддержка iPhone X и новее */
@supports (padding: max(0px)) {
    .actions-bar {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .photos-grid {
        padding-bottom: max(65px, env(safe-area-inset-bottom) + 55px);
    }
}

/* Сетка фотографий для десктопа */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-color);
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Оверлей фотографии */
.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

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

.overlay-content {
    text-align: center;
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.photo-item:hover .overlay-content {
    transform: translateY(0);
}

/* Кнопки действий */
.photo-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.photo-item:hover .photo-actions {
    opacity: 1;
}

.photo-action-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.photo-action-btn i {
    font-size: 20px;
}

.photo-action-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

/* Состояние выбранного фото */
.photo-item.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    z-index: 1;
    pointer-events: none;
}

.photo-item.selected .photo-action-btn.select-photo {
    background: #4CAF50;
    color: white;
}

/* Метаданные альбома */
body.dark .album-meta {
    border-bottom-color: var(--dark-border);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-item {
    animation: fadeIn 0.6s ease backwards;
}

/* Индикатор загрузки */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    min-width: 400px;
}

.progress-indicator {
    background: var(--button-bg);
    padding: 2rem;
    border-radius: 8px;
    color: var(--text-color);
}

.progress-text {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
}

.progress-status {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Улучшенные эффекты наведения */
.photo-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.photo-item:hover::after {
    opacity: 1;
}

/* Анимация для счетчика выбранных фото */
.counter {
    transition: all 0.3s ease;
}

.primary-action .counter {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-weight: 600;
}

/* Состояние пустого альбома */
.no-photos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 2rem;
    color: var(--light-text-secondary);
}

.no-photos i {
    font-size: 4rem;
    margin-bottom: 2rem;
    opacity: 0.5;
}

.no-photos p {
    font-size: 1.8rem;
}

body:not(.light) .no-photos {
    color: var(--dark-text-secondary);
}

/* Индикатор прогресса */
.progress-indicator {
    background: rgba(0, 0, 0, 0.85);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.progress-text {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.percent-text {
    color: #4CAF50;
    font-size: 2.2rem;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.progress-status {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4rem;
    margin-top: 10px;
}

.share-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.share-notification.show {
    opacity: 1;
    visibility: visible;
}

/* Темная тема для уведомления */
[data-theme='dark'] .share-notification {
    background: rgba(255, 255, 255, 0.9);
    color: black;
}


/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-button {
        font-size: 12px;
        padding: 0 8px;
    }

    .quick-action-btn {
        width: 28px;
        height: 28px;
    }

    .quick-action-btn i {
        font-size: 14px;
    }
}

/* Мобильная версия */
@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
        padding: 1px;
    }

    .photo-item {
        border-radius: 0;
        box-shadow: none;
    }

    .photo-actions {
        display: none;
    }

    .photo-quick-actions {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-between;
        padding: 8px;
        background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    }

    .quick-action-btn {
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.9);
        color: #333;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quick-action-btn i {
        font-size: 16px;
    }
} 