/* ===== ADMIN PHOTOS PAGE ===== */

.admin-page {
    padding: 2rem 0;
    background: var(--color-background);
    min-height: calc(100vh - 300px);
}

.admin-page .container {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.admin-header h2 {
    font-size: 2rem;
    margin: 0 0 0.3rem 0;
    color: var(--color-text);
    font-weight: 700;
}

.admin-subtitle {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.add-btn, .back-btn {
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.add-btn {
    background: #20b090;
    color: white;
}

.add-btn:hover {
    background: #1a9878;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(32, 176, 144, 0.3);
}

.back-btn {
    background: #e0e0e0;
    color: #333;
}

.back-btn:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

/* Messages */
.success-message, .error-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-message {
    background: #e8f5f0;
    color: #047857;
    border-left: 4px solid #047857;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

/* Bulk actions */
.bulk-actions {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bulk-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 1rem;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    user-select: none;
}

.select-all-label input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #20b090;
}

.delete-bulk {
    padding: 0.7rem 1.3rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.delete-bulk:hover:not(:disabled) {
    background: #c41e3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.delete-bulk:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Photos grid - 4 KOLOMMEN OP PC */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.photo-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: visible;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.photo-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #20b090;
}

.photo-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.photo-checkbox {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.photo-checkbox input {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    z-index: 5;
    cursor: pointer;
    accent-color: white;
}

.photo-checkbox img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
}

.checkbox-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: #20b090;
    border: 2px solid white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-checkbox input:checked ~ .checkbox-overlay {
    opacity: 1;
}

.photo-checkbox input:checked ~ img {
    opacity: 0.6;
    filter: brightness(0.85);
}

/* Photo details */
.photo-details {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.photo-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
}

.category-badge {
    display: inline-block;
    margin: 0 0 0.8rem 0;
    padding: 0.3rem 0.6rem;
    background: #f0f0f0;
    color: #666;
    font-size: 0.8rem;
    border-radius: 4px;
    max-width: fit-content;
}

.category-badge.child-count {
    background: #e8f4fc;
    color: #0066cc;
}

.photo-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.sort-input {
    width: 4.5rem;
    min-width: 4.5rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #f9f9f9;
    color: #333;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sort-input:focus {
    outline: none;
    border-color: #20b090;
    background: white;
    box-shadow: 0 0 0 3px rgba(32, 176, 144, 0.1);
}

.photo-actions .action-btn.edit-btn {
    padding: 0.5rem 1rem;
    background: #20b090;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 7.5rem;
    transition: all 0.2s ease;
}

.photo-actions .action-btn.edit-btn:hover {
    background: #1a9b7a;
    transform: translateY(-1px);
}

.photo-actions .delete-single {
    padding: 0.5rem 1rem;
    background: #dc2626;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 9rem;
}

.photo-actions .delete-single:hover {
    background: #c41e3a;
    transform: scale(1.08);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.7rem 1rem;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #ddd;
    min-width: 44px;
    text-align: center;
}

.pagination a:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.pagination a.active {
    background: #20b090;
    color: white;
    border-color: #20b090;
}

/* Responsive */
@media (max-width: 1400px) {
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 1000px) {
    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .admin-page {
        padding: 1.5rem 0;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-actions {
        width: 100%;
        flex-direction: column;
    }

    .page-actions .add-btn,
    .page-actions .back-btn {
        width: 100%;
        text-align: center;
    }

    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .photo-image-wrapper {
        height: 150px;
    }

    .bulk-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .bulk-controls .add-btn {
        width: 100%;
    }

    .delete-bulk {
        width: 100%;
    }

    .photo-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .photo-actions .sort-input,
    .photo-actions .action-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .admin-page {
        padding: 1rem 0;
    }

    .admin-header h2 {
        font-size: 1.5rem;
    }

    .photos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .photo-image-wrapper {
        height: 180px;
    }

    .photo-details {
        padding: 0.8rem;
    }

    .pagination {
        gap: 0.5rem;
    }

    .pagination a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: 36px;
    }
}
