/* Modern Photo Cards in Folders */
.photo-card {
    display: block;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: normal;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.photo-card-inner {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    position: relative;
    border: 2px solid #f0f0f0;
    transition: border-color 0.2s ease;
}

.photo-card:hover .photo-card-inner {
    border-color: #4CAF50;
}

.photo-thumb {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f5f5f5;
}

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

.photo-card:hover .photo-thumb img {
    transform: scale(1.08);
}

.photo-info {
    padding: 8px 10px;
    background: #fff;
}

.photo-title {
    margin: 0 0 4px 0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.photo-category {
    margin: 0;
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

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

.photo-action {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    color: #666;
    text-decoration: none;
}

.photo-action svg {
    width: 14px;
    height: 14px;
}

.photo-action:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.photo-action.action-cover {
    border: 2px solid transparent;
}

.photo-action.action-cover.set {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.photo-action.action-cover:hover {
    background: #4CAF50;
    color: #fff;
}

.photo-action.action-move:hover {
    background: #2196F3;
    color: #fff;
}

.photo-action.action-delete:hover {
    background: #f44336;
    color: #fff;
}

.photo-action.action-portfolio {
    opacity: 0.4;
    filter: grayscale(100%);
}

.photo-action.action-portfolio.set {
    opacity: 1;
    filter: grayscale(0%);
    background: #FFF9C4;
}

.photo-action.action-portfolio:hover {
    background: #FFEB3B;
    opacity: 1;
    filter: grayscale(0%);
}

.photo-action.action-edit:hover {
    background: #FF9800;
    color: #fff;
}

.photo-action.action-sell {
    border: 2px solid transparent;
}

.photo-action.action-sell.set {
    background: #27ae60;
    color: #fff;
    border-color: #27ae60;
}

.photo-action.action-sell:hover {
    background: #2ecc71;
    color: #fff;
}

.photo-sale-status {
    margin: 6px 10px 12px;
    font-size: 11px;
    color: #777;
    background: rgba(0,0,0,0.05);
    padding: 4px 8px;
    border-radius: 999px;
    display: inline-block;
}

.photo-sale-status-approved {
    background: rgba(39, 174, 96, 0.15);
    color: #1e8449;
}

.photo-sale-status-pending {
    background: rgba(241, 196, 15, 0.18);
    color: #af7f00;
}

.photo-sale-status-rejected {
    background: rgba(231, 76, 60, 0.16);
    color: #922b21;
}

/* Grid layout */
#folderview {
    margin: 40px 0 20px 0 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    clear: both !important;
    float: none !important;
    position: relative !important;
}

/* Ensure zak1 doesn't affect folderview or tworczosc-images-wrapper */
.zak1 {
    clear: both !important;
    float: none !important;
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
    position: relative !important;
}

/* Ensure folderview is positioned after zak1 */
.zak1 + #folderview,
.zak1 ~ #folderview {
    clear: both !important;
    float: none !important;
    display: grid !important;
    position: relative !important;
    margin-top: 40px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure tworczosc-images-wrapper is positioned after zak1 */
.zak1 + .tworczosc-images-wrapper,
.zak1 ~ .tworczosc-images-wrapper {
    clear: both !important;
    float: none !important;
    display: grid !important;
    position: relative !important;
    margin-top: 40px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Wrapper for tworczosc2 images */
.tworczosc-images-wrapper {
    margin: 40px 0 20px 0 !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    clear: both !important;
    float: none !important;
    position: relative !important;
    font-size: 14px !important;
}

.tworczosc-images-wrapper .photo-card {
    font-size: 14px; /* Reset font-size for card content */
    width: 100% !important;
    margin: 0 !important;
}

/* Responsive */
@media (max-width: 1200px) {
    #folderview,
    .tworczosc-images-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 992px) {
    #folderview,
    .tworczosc-images-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 768px) {
    #folderview,
    .tworczosc-images-wrapper {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    #folderview,
    .tworczosc-images-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* Cover indicator badge */
.photo-action.action-cover.set::before {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #FFD700;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: pulse 2s infinite;
}

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

/* Drag & drop placeholder */
.photo-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.photo-card.drag-over {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.05);
}

/* Zdjęcia z brakującymi plikami - wymagają przywrócenia */
.photo-card.photo-missing .photo-card-inner {
    border-color: #ff9800;
    border-width: 2px;
    border-style: dashed;
    background: #fff8f0;
}

.photo-card.photo-missing:hover .photo-card-inner {
    border-color: #f57c00;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.photo-missing-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;
    z-index: 5;
    border-radius: 10px 10px 0 0;
    pointer-events: none; /* Pozwól kliknięciom przechodzić przez overlay do linku */
}

.photo-missing-badge {
    background: #ff9800;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none; /* Badge też nie powinien blokować kliknięć */
}

.photo-missing-badge i {
    font-size: 14px;
}

.photo-placeholder {
    opacity: 0.5;
    filter: grayscale(100%);
}

.photo-card.photo-missing .photo-thumb {
    background: #f5f5f5;
    position: relative;
}

.photo-card.photo-missing .photo-title {
    color: #ff9800;
    font-weight: 700;
}

/* Przycisk restore - zawsze widoczny dla zdjęć z brakującymi plikami */
.photo-card.photo-missing .photo-actions {
    opacity: 1 !important;
}

.photo-action.action-restore {
    background: #ff9800;
    color: #fff;
    border: 2px solid #ff9800;
    animation: pulse-restore 2s infinite;
}

.photo-action.action-restore:hover {
    background: #f57c00;
    border-color: #f57c00;
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.5);
}

@keyframes pulse-restore {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }
    50% {
        box-shadow: 0 2px 12px rgba(255, 152, 0, 0.6);
    }
}

/* Informacje o zdjęciu z brakującym plikiem */
.photo-missing-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ffe0b2;
    font-size: 10px;
    color: #666;
    line-height: 1.6;
}

.photo-missing-info .photo-info-item {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.photo-missing-info .photo-info-item i {
    color: #ff9800;
    font-size: 11px;
    width: 14px;
    text-align: center;
}

.photo-missing-info .photo-info-item span {
    margin-right: 8px;
    white-space: nowrap;
}

.photo-missing-info .photo-info-item span:last-child {
    margin-right: 0;
}

