/* Unsplash Photo Selector Styles */

.photo-selector {
    max-width: 100%;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: transform 0.2s ease;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.photo-card {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 66.67%; /* 3:2 aspect ratio */
    background: #e9ecef;
}

.photo-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    background: #e9ecef;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.select-photo-btn {
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.photo-attribution {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1rem 0.75rem 0.5rem;
    font-size: 0.75rem;
}

.photo-pagination .page-link {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0.5rem 0.75rem;
}

.photo-pagination .page-link:hover {
    background: #e9ecef;
    color: #495057;
}

.photo-pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.photo-search .input-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-search .form-control {
    border: none;
    padding: 0.75rem 1rem;
}

.photo-search .form-control:focus {
    box-shadow: none;
    border-color: #86b7fe;
}

.photo-search .btn {
    border: none;
    background: #f8f9fa;
    color: #6c757d;
}

.photo-search .btn:hover {
    background: #e9ecef;
    color: #495057;
}

.selected-photo-info .alert {
    border: none;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.selected-attribution a {
    color: inherit;
    text-decoration: underline;
}

.selected-attribution a:hover {
    text-decoration: none;
}

/* Loading states */
.photo-selector .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .photo-card {
        padding-bottom: 75%; /* Square aspect ratio on mobile */
    }

    .select-photo-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}